]> source.dussan.org Git - sonarqube.git/blob
4e2b7044f5d46ca8c83fe3396eb7a2bb57bab211
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render flow locations in different file 1`] = `
4 <CrossFileLocationsNavigator
5   isTaintAnalysis={false}
6   issue={
7     Object {
8       "actions": Array [],
9       "component": "foo",
10       "componentLongName": "main.js",
11       "componentQualifier": "FIL",
12       "componentUuid": "foo1234",
13       "creationDate": "2017-03-01T09:36:01+0100",
14       "flows": Array [
15         Array [
16           Object {
17             "component": "foo",
18             "componentName": "src/foo.js",
19             "msg": "Do not use foo",
20             "textRange": Object {
21               "endLine": 7,
22               "endOffset": 8,
23               "startLine": 7,
24               "startOffset": 5,
25             },
26           },
27           Object {
28             "component": "bar",
29             "componentName": "src/bar.js",
30             "msg": "Do not use bar",
31             "textRange": Object {
32               "endLine": 16,
33               "endOffset": 6,
34               "startLine": 15,
35               "startOffset": 4,
36             },
37           },
38         ],
39       ],
40       "fromHotspot": false,
41       "key": "",
42       "line": 25,
43       "message": "Reduce the number of conditional operators (4) used in the expression",
44       "organization": "myorg",
45       "project": "myproject",
46       "projectKey": "foo",
47       "projectName": "Foo",
48       "projectOrganization": "org",
49       "rule": "javascript:S1067",
50       "ruleName": "foo",
51       "secondaryLocations": Array [],
52       "severity": "MAJOR",
53       "status": "OPEN",
54       "textRange": Object {
55         "endLine": 26,
56         "endOffset": 15,
57         "startLine": 25,
58         "startOffset": 0,
59       },
60       "transitions": Array [],
61       "type": "BUG",
62     }
63   }
64   locations={
65     Array [
66       Object {
67         "component": "foo",
68         "componentName": "src/foo.js",
69         "msg": "Do not use foo",
70         "textRange": Object {
71           "endLine": 7,
72           "endOffset": 8,
73           "startLine": 7,
74           "startOffset": 5,
75         },
76       },
77       Object {
78         "component": "bar",
79         "componentName": "src/bar.js",
80         "msg": "Do not use bar",
81         "textRange": Object {
82           "endLine": 16,
83           "endOffset": 6,
84           "startLine": 15,
85           "startOffset": 4,
86         },
87       },
88     ]
89   }
90   onLocationSelect={[MockFunction]}
91   scroll={[MockFunction]}
92 />
93 `;
94
95 exports[`should render flow locations in the same file 1`] = `
96 <div
97   className="concise-issue-locations-navigator spacer-top"
98 >
99   <ConciseIssueLocationsNavigatorLocation
100     index={0}
101     isTaintAnalysis={false}
102     key="0"
103     message="Do not use foo"
104     onClick={[MockFunction]}
105     scroll={[MockFunction]}
106     selected={false}
107     totalCount={2}
108   />
109   <ConciseIssueLocationsNavigatorLocation
110     index={1}
111     isTaintAnalysis={false}
112     key="1"
113     message="Do not use foo"
114     onClick={[MockFunction]}
115     scroll={[MockFunction]}
116     selected={false}
117     totalCount={2}
118   />
119 </div>
120 `;
121
122 exports[`should render secondary locations in the same file 1`] = `
123 <div
124   className="concise-issue-locations-navigator spacer-top"
125 >
126   <ConciseIssueLocationsNavigatorLocation
127     index={0}
128     isTaintAnalysis={false}
129     key="0"
130     message="Do not use foo"
131     onClick={[MockFunction]}
132     scroll={[MockFunction]}
133     selected={false}
134     totalCount={2}
135   />
136   <ConciseIssueLocationsNavigatorLocation
137     index={1}
138     isTaintAnalysis={false}
139     key="1"
140     message="Do not use foo"
141     onClick={[MockFunction]}
142     scroll={[MockFunction]}
143     selected={false}
144     totalCount={2}
145   />
146 </div>
147 `;
148
149 exports[`should render selected flow locations in the same file 1`] = `
150 <div
151   className="concise-issue-locations-navigator spacer-top"
152 >
153   <ConciseIssueLocationsNavigatorLocation
154     index={0}
155     isTaintAnalysis={false}
156     key="0"
157     message="Do not use foo"
158     onClick={[MockFunction]}
159     scroll={[MockFunction]}
160     selected={false}
161     totalCount={2}
162   />
163   <ConciseIssueLocationsNavigatorLocation
164     index={1}
165     isTaintAnalysis={false}
166     key="1"
167     message="Do not use foo"
168     onClick={[MockFunction]}
169     scroll={[MockFunction]}
170     selected={false}
171     totalCount={2}
172   />
173 </div>
174 `;
175
176 exports[`should render taint analysis issues correctly 1`] = `
177 <CrossFileLocationsNavigator
178   isTaintAnalysis={true}
179   issue={
180     Object {
181       "actions": Array [],
182       "component": "foo",
183       "componentLongName": "main.js",
184       "componentQualifier": "FIL",
185       "componentUuid": "foo1234",
186       "creationDate": "2017-03-01T09:36:01+0100",
187       "flows": Array [
188         Array [
189           Object {
190             "component": "foo",
191             "componentName": "src/foo.js",
192             "msg": "Do not use foo",
193             "textRange": Object {
194               "endLine": 7,
195               "endOffset": 8,
196               "startLine": 7,
197               "startOffset": 5,
198             },
199           },
200           Object {
201             "component": "foo",
202             "componentName": "src/foo.js",
203             "msg": "Do not use foo",
204             "textRange": Object {
205               "endLine": 8,
206               "endOffset": 5,
207               "startLine": 8,
208               "startOffset": 0,
209             },
210           },
211           Object {
212             "component": "bar",
213             "componentName": "src/bar.js",
214             "msg": "Do not use bar",
215             "textRange": Object {
216               "endLine": 16,
217               "endOffset": 6,
218               "startLine": 15,
219               "startOffset": 4,
220             },
221           },
222         ],
223       ],
224       "fromHotspot": false,
225       "key": "",
226       "line": 25,
227       "message": "Reduce the number of conditional operators (4) used in the expression",
228       "organization": "myorg",
229       "project": "myproject",
230       "projectKey": "foo",
231       "projectName": "Foo",
232       "projectOrganization": "org",
233       "rule": "javascript:S1067",
234       "ruleName": "foo",
235       "secondaryLocations": Array [],
236       "severity": "MAJOR",
237       "status": "OPEN",
238       "textRange": Object {
239         "endLine": 26,
240         "endOffset": 15,
241         "startLine": 25,
242         "startOffset": 0,
243       },
244       "transitions": Array [],
245       "type": "VULNERABILITY",
246     }
247   }
248   locations={
249     Array [
250       Object {
251         "component": "foo",
252         "componentName": "src/foo.js",
253         "msg": "Do not use foo",
254         "textRange": Object {
255           "endLine": 7,
256           "endOffset": 8,
257           "startLine": 7,
258           "startOffset": 5,
259         },
260       },
261       Object {
262         "component": "foo",
263         "componentName": "src/foo.js",
264         "msg": "Do not use foo",
265         "textRange": Object {
266           "endLine": 8,
267           "endOffset": 5,
268           "startLine": 8,
269           "startOffset": 0,
270         },
271       },
272       Object {
273         "component": "bar",
274         "componentName": "src/bar.js",
275         "msg": "Do not use bar",
276         "textRange": Object {
277           "endLine": 16,
278           "endOffset": 6,
279           "startLine": 15,
280           "startOffset": 4,
281         },
282       },
283     ]
284   }
285   onLocationSelect={[MockFunction]}
286   scroll={[MockFunction]}
287 />
288 `;