aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers
diff options
context:
space:
mode:
author7PH <benjamin.raymond@sonarsource.com>2023-03-28 17:57:12 +0200
committersonartech <sonartech@sonarsource.com>2023-03-30 20:03:06 +0000
commita35ce4635c89cf21d3aba13be7971575c5070ca7 (patch)
tree07b97d4a0b8dfd3d0350f3bba65989d009b34039 /server/sonar-web/src/main/js/helpers
parent1311ea6ec6295d807c9a5588d6dc14c887fbd41d (diff)
downloadsonarqube-a35ce4635c89cf21d3aba13be7971575c5070ca7.tar.gz
sonarqube-a35ce4635c89cf21d3aba13be7971575c5070ca7.zip
SONAR-18555 Migrate issues app sidebar to RTL
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
-rw-r--r--server/sonar-web/src/main/js/helpers/mocks/issues.ts37
-rw-r--r--server/sonar-web/src/main/js/helpers/testMocks.ts13
2 files changed, 45 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/helpers/mocks/issues.ts b/server/sonar-web/src/main/js/helpers/mocks/issues.ts
index 6cd3522686b..e77d65a4038 100644
--- a/server/sonar-web/src/main/js/helpers/mocks/issues.ts
+++ b/server/sonar-web/src/main/js/helpers/mocks/issues.ts
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Query } from '../../apps/issues/utils';
import { ReferencedRule } from '../../types/issues';
import { IssueChangelog } from '../../types/types';
@@ -44,3 +45,39 @@ export function mockIssueChangelog(overrides: Partial<IssueChangelog> = {}): Iss
...overrides,
};
}
+
+export function mockQuery(overrides: Partial<Query> = {}): Query {
+ return {
+ assigned: false,
+ assignees: [],
+ author: [],
+ createdAfter: undefined,
+ createdAt: '',
+ createdBefore: undefined,
+ createdInLast: '',
+ cwe: [],
+ directories: [],
+ files: [],
+ issues: [],
+ languages: [],
+ owaspTop10: [],
+ 'owaspTop10-2021': [],
+ 'pciDss-3.2': [],
+ 'pciDss-4.0': [],
+ 'owaspAsvs-4.0': [],
+ owaspAsvsLevel: '',
+ projects: [],
+ resolutions: [],
+ resolved: false,
+ rules: [],
+ scopes: [],
+ severities: [],
+ inNewCodePeriod: false,
+ sonarsourceSecurity: [],
+ sort: '',
+ statuses: [],
+ tags: [],
+ types: [],
+ ...overrides,
+ };
+}
diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts
index 350205aa30e..758edd11a4d 100644
--- a/server/sonar-web/src/main/js/helpers/testMocks.ts
+++ b/server/sonar-web/src/main/js/helpers/testMocks.ts
@@ -25,7 +25,7 @@ import { Location, Router } from '../components/hoc/withRouter';
import { AppState } from '../types/appstate';
import { RuleRepository } from '../types/coding-rules';
import { EditionKey } from '../types/editions';
-import { IssueType, RawIssue } from '../types/issues';
+import { IssueScope, IssueSeverity, IssueStatus, IssueType, RawIssue } from '../types/issues';
import { Language } from '../types/languages';
import { DumpStatus, DumpTask } from '../types/project-dump';
import { TaskStatuses } from '../types/tasks';
@@ -286,13 +286,15 @@ export function mockRawIssue(withLocations = false, overrides: Partial<RawIssue>
actions: [],
component: 'main.js',
key: 'AVsae-CQS-9G3txfbFN2',
+ creationDate: '2023-01-15T09:36:01+0100',
line: 25,
project: 'myproject',
rule: 'javascript:S1067',
- severity: 'MAJOR',
- status: 'OPEN',
+ severity: IssueSeverity.Major,
+ status: IssueStatus.Open,
textRange: { startLine: 25, endLine: 26, startOffset: 0, endOffset: 15 },
type: IssueType.CodeSmell,
+ scope: IssueScope.Main,
...overrides,
};
@@ -334,9 +336,10 @@ export function mockIssue(withLocations = false, overrides: Partial<Issue> = {})
projectName: 'Foo',
rule: 'javascript:S1067',
ruleName: 'foo',
+ scope: IssueScope.Main,
secondaryLocations: [],
- severity: 'MAJOR',
- status: 'OPEN',
+ severity: IssueSeverity.Major,
+ status: IssueStatus.Open,
textRange: { startLine: 25, endLine: 26, startOffset: 0, endOffset: 15 },
transitions: [],
type: 'BUG',