]> source.dussan.org Git - sonarqube.git/blob
1c7210b016865fd489d72b1663913ebf0e9f4918
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`Should handle no access rights 1`] = `
4 <Alert
5   className="spacer-top"
6   variant="warning"
7 >
8   code_viewer.no_source_code_displayed_due_to_security
9 </Alert>
10 `;
11
12 exports[`should handle duplication popup 1`] = `
13 <Context.Consumer>
14   [Function]
15 </Context.Consumer>
16 `;
17
18 exports[`should render correctly 1`] = `
19 <div>
20   <DeferredSpinner />
21 </div>
22 `;
23
24 exports[`should render correctly 2`] = `
25 <div>
26   <ContextProvider
27     key="1-0-0"
28     value={
29       Object {
30         "branchLike": undefined,
31         "file": Object {
32           "key": "main.js",
33           "measures": Object {
34             "coverage": "85.2",
35             "duplicationDensity": "1.0",
36             "issues": "12",
37             "lines": "56",
38           },
39           "path": "main.js",
40           "project": "my-project",
41           "projectName": "MyProject",
42           "q": "FIL",
43           "uuid": "foo-bar",
44         },
45       }
46     }
47   >
48     <ComponentSourceSnippetGroupViewer
49       duplicationsByLine={Object {}}
50       isLastOccurenceOfPrimaryComponent={true}
51       issue={
52         Object {
53           "actions": Array [],
54           "component": "main.js",
55           "componentLongName": "main.js",
56           "componentQualifier": "FIL",
57           "componentUuid": "foo1234",
58           "creationDate": "2017-03-01T09:36:01+0100",
59           "flows": Array [
60             Array [
61               Object {
62                 "component": "main.js",
63                 "textRange": Object {
64                   "endLine": 2,
65                   "endOffset": 2,
66                   "startLine": 1,
67                   "startOffset": 1,
68                 },
69               },
70               Object {
71                 "component": "main.js",
72                 "textRange": Object {
73                   "endLine": 2,
74                   "endOffset": 2,
75                   "startLine": 1,
76                   "startOffset": 1,
77                 },
78               },
79               Object {
80                 "component": "main.js",
81                 "textRange": Object {
82                   "endLine": 2,
83                   "endOffset": 2,
84                   "startLine": 1,
85                   "startOffset": 1,
86                 },
87               },
88             ],
89             Array [
90               Object {
91                 "component": "main.js",
92                 "textRange": Object {
93                   "endLine": 2,
94                   "endOffset": 2,
95                   "startLine": 1,
96                   "startOffset": 1,
97                 },
98               },
99               Object {
100                 "component": "main.js",
101                 "textRange": Object {
102                   "endLine": 2,
103                   "endOffset": 2,
104                   "startLine": 1,
105                   "startOffset": 1,
106                 },
107               },
108             ],
109           ],
110           "fromHotspot": false,
111           "key": "1",
112           "line": 25,
113           "message": "Reduce the number of conditional operators (4) used in the expression",
114           "project": "myproject",
115           "projectKey": "foo",
116           "projectName": "Foo",
117           "rule": "javascript:S1067",
118           "ruleName": "foo",
119           "secondaryLocations": Array [
120             Object {
121               "component": "main.js",
122               "textRange": Object {
123                 "endLine": 2,
124                 "endOffset": 2,
125                 "startLine": 1,
126                 "startOffset": 1,
127               },
128             },
129             Object {
130               "component": "main.js",
131               "textRange": Object {
132                 "endLine": 2,
133                 "endOffset": 2,
134                 "startLine": 1,
135                 "startOffset": 1,
136               },
137             },
138           ],
139           "severity": "MAJOR",
140           "status": "OPEN",
141           "textRange": Object {
142             "endLine": 26,
143             "endOffset": 15,
144             "startLine": 25,
145             "startOffset": 0,
146           },
147           "transitions": Array [],
148           "type": "BUG",
149         }
150       }
151       issuesByLine={Object {}}
152       lastSnippetGroup={true}
153       loadDuplications={[Function]}
154       locations={
155         Array [
156           Object {
157             "component": "main.js",
158             "index": 0,
159             "textRange": Object {
160               "endLine": 2,
161               "endOffset": 2,
162               "startLine": 1,
163               "startOffset": 1,
164             },
165           },
166         ]
167       }
168       onIssueChange={[MockFunction]}
169       onIssuePopupToggle={[Function]}
170       onLocationSelect={[MockFunction]}
171       renderDuplicationPopup={[Function]}
172       scroll={[MockFunction]}
173       snippetGroup={
174         Object {
175           "component": Object {
176             "key": "main.js",
177             "measures": Object {
178               "coverage": "85.2",
179               "duplicationDensity": "1.0",
180               "issues": "12",
181               "lines": "56",
182             },
183             "path": "main.js",
184             "project": "my-project",
185             "projectName": "MyProject",
186             "q": "FIL",
187             "uuid": "foo-bar",
188           },
189           "locations": Array [
190             Object {
191               "component": "main.js",
192               "index": 0,
193               "textRange": Object {
194                 "endLine": 2,
195                 "endOffset": 2,
196                 "startLine": 1,
197                 "startOffset": 1,
198               },
199             },
200           ],
201           "sources": Object {
202             "16": Object {
203               "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
204               "coverageStatus": "covered",
205               "coveredConditions": 2,
206               "duplicated": false,
207               "isNew": true,
208               "line": 16,
209               "scmAuthor": "simon.brandhof@sonarsource.com",
210               "scmDate": "2018-12-11T10:48:39+0100",
211               "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
212             },
213           },
214         }
215       }
216     />
217   </ContextProvider>
218 </div>
219 `;
220
221 exports[`should render correctly: no component found 1`] = `
222 <div>
223   <ContextProvider
224     key="unknown-0-0"
225     value={
226       Object {
227         "branchLike": undefined,
228         "file": Object {},
229       }
230     }
231   >
232     <ComponentSourceSnippetGroupViewer
233       duplicationsByLine={Object {}}
234       isLastOccurenceOfPrimaryComponent={false}
235       issue={
236         Object {
237           "actions": Array [],
238           "component": "test.js",
239           "componentLongName": "main.js",
240           "componentQualifier": "FIL",
241           "componentUuid": "foo1234",
242           "creationDate": "2017-03-01T09:36:01+0100",
243           "flows": Array [
244             Array [
245               Object {
246                 "component": "main.js",
247                 "textRange": Object {
248                   "endLine": 2,
249                   "endOffset": 2,
250                   "startLine": 1,
251                   "startOffset": 1,
252                 },
253               },
254               Object {
255                 "component": "main.js",
256                 "textRange": Object {
257                   "endLine": 2,
258                   "endOffset": 2,
259                   "startLine": 1,
260                   "startOffset": 1,
261                 },
262               },
263               Object {
264                 "component": "main.js",
265                 "textRange": Object {
266                   "endLine": 2,
267                   "endOffset": 2,
268                   "startLine": 1,
269                   "startOffset": 1,
270                 },
271               },
272             ],
273             Array [
274               Object {
275                 "component": "main.js",
276                 "textRange": Object {
277                   "endLine": 2,
278                   "endOffset": 2,
279                   "startLine": 1,
280                   "startOffset": 1,
281                 },
282               },
283               Object {
284                 "component": "main.js",
285                 "textRange": Object {
286                   "endLine": 2,
287                   "endOffset": 2,
288                   "startLine": 1,
289                   "startOffset": 1,
290                 },
291               },
292             ],
293           ],
294           "fromHotspot": false,
295           "key": "unknown",
296           "line": 25,
297           "message": "Reduce the number of conditional operators (4) used in the expression",
298           "project": "myproject",
299           "projectKey": "foo",
300           "projectName": "Foo",
301           "rule": "javascript:S1067",
302           "ruleName": "foo",
303           "secondaryLocations": Array [
304             Object {
305               "component": "main.js",
306               "textRange": Object {
307                 "endLine": 2,
308                 "endOffset": 2,
309                 "startLine": 1,
310                 "startOffset": 1,
311               },
312             },
313             Object {
314               "component": "main.js",
315               "textRange": Object {
316                 "endLine": 2,
317                 "endOffset": 2,
318                 "startLine": 1,
319                 "startOffset": 1,
320               },
321             },
322           ],
323           "severity": "MAJOR",
324           "status": "OPEN",
325           "textRange": Object {
326             "endLine": 26,
327             "endOffset": 15,
328             "startLine": 25,
329             "startOffset": 0,
330           },
331           "transitions": Array [],
332           "type": "BUG",
333         }
334       }
335       issuesByLine={Object {}}
336       lastSnippetGroup={false}
337       loadDuplications={[Function]}
338       locations={Array []}
339       onIssueChange={[MockFunction]}
340       onIssuePopupToggle={[Function]}
341       onLocationSelect={[MockFunction]}
342       renderDuplicationPopup={[Function]}
343       scroll={[MockFunction]}
344       snippetGroup={
345         Object {
346           "component": Object {},
347           "locations": Array [],
348           "sources": Array [],
349         }
350       }
351     />
352   </ContextProvider>
353   <ContextProvider
354     key="unknown-0-1"
355     value={
356       Object {
357         "branchLike": undefined,
358         "file": Object {
359           "key": "main.js",
360           "measures": Object {
361             "coverage": "85.2",
362             "duplicationDensity": "1.0",
363             "issues": "12",
364             "lines": "56",
365           },
366           "path": "main.js",
367           "project": "my-project",
368           "projectName": "MyProject",
369           "q": "FIL",
370           "uuid": "foo-bar",
371         },
372       }
373     }
374   >
375     <ComponentSourceSnippetGroupViewer
376       duplicationsByLine={Object {}}
377       isLastOccurenceOfPrimaryComponent={false}
378       issue={
379         Object {
380           "actions": Array [],
381           "component": "test.js",
382           "componentLongName": "main.js",
383           "componentQualifier": "FIL",
384           "componentUuid": "foo1234",
385           "creationDate": "2017-03-01T09:36:01+0100",
386           "flows": Array [
387             Array [
388               Object {
389                 "component": "main.js",
390                 "textRange": Object {
391                   "endLine": 2,
392                   "endOffset": 2,
393                   "startLine": 1,
394                   "startOffset": 1,
395                 },
396               },
397               Object {
398                 "component": "main.js",
399                 "textRange": Object {
400                   "endLine": 2,
401                   "endOffset": 2,
402                   "startLine": 1,
403                   "startOffset": 1,
404                 },
405               },
406               Object {
407                 "component": "main.js",
408                 "textRange": Object {
409                   "endLine": 2,
410                   "endOffset": 2,
411                   "startLine": 1,
412                   "startOffset": 1,
413                 },
414               },
415             ],
416             Array [
417               Object {
418                 "component": "main.js",
419                 "textRange": Object {
420                   "endLine": 2,
421                   "endOffset": 2,
422                   "startLine": 1,
423                   "startOffset": 1,
424                 },
425               },
426               Object {
427                 "component": "main.js",
428                 "textRange": Object {
429                   "endLine": 2,
430                   "endOffset": 2,
431                   "startLine": 1,
432                   "startOffset": 1,
433                 },
434               },
435             ],
436           ],
437           "fromHotspot": false,
438           "key": "unknown",
439           "line": 25,
440           "message": "Reduce the number of conditional operators (4) used in the expression",
441           "project": "myproject",
442           "projectKey": "foo",
443           "projectName": "Foo",
444           "rule": "javascript:S1067",
445           "ruleName": "foo",
446           "secondaryLocations": Array [
447             Object {
448               "component": "main.js",
449               "textRange": Object {
450                 "endLine": 2,
451                 "endOffset": 2,
452                 "startLine": 1,
453                 "startOffset": 1,
454               },
455             },
456             Object {
457               "component": "main.js",
458               "textRange": Object {
459                 "endLine": 2,
460                 "endOffset": 2,
461                 "startLine": 1,
462                 "startOffset": 1,
463               },
464             },
465           ],
466           "severity": "MAJOR",
467           "status": "OPEN",
468           "textRange": Object {
469             "endLine": 26,
470             "endOffset": 15,
471             "startLine": 25,
472             "startOffset": 0,
473           },
474           "transitions": Array [],
475           "type": "BUG",
476         }
477       }
478       issuesByLine={Object {}}
479       lastSnippetGroup={true}
480       loadDuplications={[Function]}
481       locations={
482         Array [
483           Object {
484             "component": "main.js",
485             "index": 0,
486             "textRange": Object {
487               "endLine": 2,
488               "endOffset": 2,
489               "startLine": 1,
490               "startOffset": 1,
491             },
492           },
493         ]
494       }
495       onIssueChange={[MockFunction]}
496       onIssuePopupToggle={[Function]}
497       onLocationSelect={[MockFunction]}
498       renderDuplicationPopup={[Function]}
499       scroll={[MockFunction]}
500       snippetGroup={
501         Object {
502           "component": Object {
503             "key": "main.js",
504             "measures": Object {
505               "coverage": "85.2",
506               "duplicationDensity": "1.0",
507               "issues": "12",
508               "lines": "56",
509             },
510             "path": "main.js",
511             "project": "my-project",
512             "projectName": "MyProject",
513             "q": "FIL",
514             "uuid": "foo-bar",
515           },
516           "locations": Array [
517             Object {
518               "component": "main.js",
519               "index": 0,
520               "textRange": Object {
521                 "endLine": 2,
522                 "endOffset": 2,
523                 "startLine": 1,
524                 "startOffset": 1,
525               },
526             },
527           ],
528           "sources": Object {
529             "16": Object {
530               "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
531               "coverageStatus": "covered",
532               "coveredConditions": 2,
533               "duplicated": false,
534               "isNew": true,
535               "line": 16,
536               "scmAuthor": "simon.brandhof@sonarsource.com",
537               "scmDate": "2018-12-11T10:48:39+0100",
538               "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
539             },
540           },
541         }
542       }
543     />
544   </ContextProvider>
545 </div>
546 `;