]> source.dussan.org Git - sonarqube.git/blob
44f2305d62393e55adb793f0a099dfcd4b82a8a9
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render CrossComponentSourceViewer correctly 1`] = `
4 <div>
5   <CrossComponentSourceViewer
6     branchLike={
7       Object {
8         "analysisDate": "2018-01-01",
9         "excludedFromPurge": true,
10         "isMain": true,
11         "name": "master",
12       }
13     }
14     issue={
15       Object {
16         "actions": Array [],
17         "component": "main.js",
18         "componentLongName": "main.js",
19         "componentQualifier": "FIL",
20         "componentUuid": "foo1234",
21         "creationDate": "2017-03-01T09:36:01+0100",
22         "flows": Array [
23           Array [
24             Object {
25               "component": "main.js",
26               "index": 0,
27               "textRange": Object {
28                 "endLine": 2,
29                 "endOffset": 2,
30                 "startLine": 1,
31                 "startOffset": 1,
32               },
33             },
34             Object {
35               "component": "main.js",
36               "index": 1,
37               "textRange": Object {
38                 "endLine": 12,
39                 "endOffset": 2,
40                 "startLine": 10,
41                 "startOffset": 1,
42               },
43             },
44           ],
45         ],
46         "key": "AVsae-CQS-9G3txfbFN2",
47         "line": 25,
48         "message": "Reduce the number of conditional operators (4) used in the expression",
49         "project": "myproject",
50         "projectKey": "foo",
51         "projectName": "Foo",
52         "rule": "javascript:S1067",
53         "ruleName": "foo",
54         "secondaryLocations": Array [
55           Object {
56             "component": "main.js",
57             "textRange": Object {
58               "endLine": 2,
59               "endOffset": 2,
60               "startLine": 1,
61               "startOffset": 1,
62             },
63           },
64           Object {
65             "component": "main.js",
66             "textRange": Object {
67               "endLine": 2,
68               "endOffset": 2,
69               "startLine": 1,
70               "startOffset": 1,
71             },
72           },
73         ],
74         "severity": "MAJOR",
75         "status": "OPEN",
76         "textRange": Object {
77           "endLine": 26,
78           "endOffset": 15,
79           "startLine": 25,
80           "startOffset": 0,
81         },
82         "transitions": Array [],
83         "type": "BUG",
84       }
85     }
86     issues={
87       Array [
88         Object {
89           "actions": Array [],
90           "component": "main.js",
91           "componentLongName": "main.js",
92           "componentQualifier": "FIL",
93           "componentUuid": "foo1234",
94           "creationDate": "2017-03-01T09:36:01+0100",
95           "flows": Array [
96             Array [
97               Object {
98                 "component": "main.js",
99                 "textRange": Object {
100                   "endLine": 2,
101                   "endOffset": 2,
102                   "startLine": 1,
103                   "startOffset": 1,
104                 },
105               },
106               Object {
107                 "component": "main.js",
108                 "textRange": Object {
109                   "endLine": 2,
110                   "endOffset": 2,
111                   "startLine": 1,
112                   "startOffset": 1,
113                 },
114               },
115               Object {
116                 "component": "main.js",
117                 "textRange": Object {
118                   "endLine": 2,
119                   "endOffset": 2,
120                   "startLine": 1,
121                   "startOffset": 1,
122                 },
123               },
124             ],
125             Array [
126               Object {
127                 "component": "main.js",
128                 "textRange": Object {
129                   "endLine": 2,
130                   "endOffset": 2,
131                   "startLine": 1,
132                   "startOffset": 1,
133                 },
134               },
135               Object {
136                 "component": "main.js",
137                 "textRange": Object {
138                   "endLine": 2,
139                   "endOffset": 2,
140                   "startLine": 1,
141                   "startOffset": 1,
142                 },
143               },
144             ],
145           ],
146           "key": "AVsae-CQS-9G3txfbFN2",
147           "line": 25,
148           "message": "Reduce the number of conditional operators (4) used in the expression",
149           "project": "myproject",
150           "projectKey": "foo",
151           "projectName": "Foo",
152           "rule": "javascript:S1067",
153           "ruleName": "foo",
154           "secondaryLocations": Array [
155             Object {
156               "component": "main.js",
157               "textRange": Object {
158                 "endLine": 2,
159                 "endOffset": 2,
160                 "startLine": 1,
161                 "startOffset": 1,
162               },
163             },
164             Object {
165               "component": "main.js",
166               "textRange": Object {
167                 "endLine": 2,
168                 "endOffset": 2,
169                 "startLine": 1,
170                 "startOffset": 1,
171               },
172             },
173           ],
174           "severity": "MAJOR",
175           "status": "OPEN",
176           "textRange": Object {
177             "endLine": 26,
178             "endOffset": 15,
179             "startLine": 25,
180             "startOffset": 0,
181           },
182           "transitions": Array [],
183           "type": "BUG",
184         },
185       ]
186     }
187     locations={
188       Array [
189         Object {
190           "component": "main.js",
191           "index": 0,
192           "textRange": Object {
193             "endLine": 2,
194             "endOffset": 2,
195             "startLine": 1,
196             "startOffset": 1,
197           },
198         },
199         Object {
200           "component": "main.js",
201           "index": 1,
202           "textRange": Object {
203             "endLine": 12,
204             "endOffset": 2,
205             "startLine": 10,
206             "startOffset": 1,
207           },
208         },
209       ]
210     }
211     onIssueSelect={[MockFunction]}
212     onLoaded={[Function]}
213     onLocationSelect={[MockFunction]}
214   />
215 </div>
216 `;
217
218 exports[`should render SourceViewer correctly: all secondary locations on same line 1`] = `
219 <div>
220   <CrossComponentSourceViewer
221     branchLike={
222       Object {
223         "analysisDate": "2018-01-01",
224         "excludedFromPurge": true,
225         "isMain": true,
226         "name": "master",
227       }
228     }
229     issue={
230       Object {
231         "actions": Array [],
232         "component": "main.js",
233         "componentLongName": "main.js",
234         "componentQualifier": "FIL",
235         "componentUuid": "foo1234",
236         "creationDate": "2017-03-01T09:36:01+0100",
237         "flows": Array [
238           Array [
239             Object {
240               "component": "main.js",
241               "index": 0,
242               "textRange": Object {
243                 "endLine": 2,
244                 "endOffset": 2,
245                 "startLine": 1,
246                 "startOffset": 1,
247               },
248             },
249             Object {
250               "component": "main.js",
251               "index": 1,
252               "textRange": Object {
253                 "endLine": 2,
254                 "endOffset": 2,
255                 "startLine": 1,
256                 "startOffset": 1,
257               },
258             },
259             Object {
260               "component": "main.js",
261               "index": 2,
262               "textRange": Object {
263                 "endLine": 2,
264                 "endOffset": 2,
265                 "startLine": 1,
266                 "startOffset": 1,
267               },
268             },
269           ],
270         ],
271         "key": "AVsae-CQS-9G3txfbFN2",
272         "line": 25,
273         "message": "Reduce the number of conditional operators (4) used in the expression",
274         "project": "myproject",
275         "projectKey": "foo",
276         "projectName": "Foo",
277         "rule": "javascript:S1067",
278         "ruleName": "foo",
279         "secondaryLocations": Array [
280           Object {
281             "component": "main.js",
282             "textRange": Object {
283               "endLine": 2,
284               "endOffset": 2,
285               "startLine": 1,
286               "startOffset": 1,
287             },
288           },
289           Object {
290             "component": "main.js",
291             "textRange": Object {
292               "endLine": 2,
293               "endOffset": 2,
294               "startLine": 1,
295               "startOffset": 1,
296             },
297           },
298         ],
299         "severity": "MAJOR",
300         "status": "OPEN",
301         "textRange": Object {
302           "endLine": 26,
303           "endOffset": 15,
304           "startLine": 25,
305           "startOffset": 0,
306         },
307         "transitions": Array [],
308         "type": "BUG",
309       }
310     }
311     issues={
312       Array [
313         Object {
314           "actions": Array [],
315           "component": "main.js",
316           "componentLongName": "main.js",
317           "componentQualifier": "FIL",
318           "componentUuid": "foo1234",
319           "creationDate": "2017-03-01T09:36:01+0100",
320           "flows": Array [
321             Array [
322               Object {
323                 "component": "main.js",
324                 "textRange": Object {
325                   "endLine": 2,
326                   "endOffset": 2,
327                   "startLine": 1,
328                   "startOffset": 1,
329                 },
330               },
331               Object {
332                 "component": "main.js",
333                 "textRange": Object {
334                   "endLine": 2,
335                   "endOffset": 2,
336                   "startLine": 1,
337                   "startOffset": 1,
338                 },
339               },
340               Object {
341                 "component": "main.js",
342                 "textRange": Object {
343                   "endLine": 2,
344                   "endOffset": 2,
345                   "startLine": 1,
346                   "startOffset": 1,
347                 },
348               },
349             ],
350             Array [
351               Object {
352                 "component": "main.js",
353                 "textRange": Object {
354                   "endLine": 2,
355                   "endOffset": 2,
356                   "startLine": 1,
357                   "startOffset": 1,
358                 },
359               },
360               Object {
361                 "component": "main.js",
362                 "textRange": Object {
363                   "endLine": 2,
364                   "endOffset": 2,
365                   "startLine": 1,
366                   "startOffset": 1,
367                 },
368               },
369             ],
370           ],
371           "key": "AVsae-CQS-9G3txfbFN2",
372           "line": 25,
373           "message": "Reduce the number of conditional operators (4) used in the expression",
374           "project": "myproject",
375           "projectKey": "foo",
376           "projectName": "Foo",
377           "rule": "javascript:S1067",
378           "ruleName": "foo",
379           "secondaryLocations": Array [
380             Object {
381               "component": "main.js",
382               "textRange": Object {
383                 "endLine": 2,
384                 "endOffset": 2,
385                 "startLine": 1,
386                 "startOffset": 1,
387               },
388             },
389             Object {
390               "component": "main.js",
391               "textRange": Object {
392                 "endLine": 2,
393                 "endOffset": 2,
394                 "startLine": 1,
395                 "startOffset": 1,
396               },
397             },
398           ],
399           "severity": "MAJOR",
400           "status": "OPEN",
401           "textRange": Object {
402             "endLine": 26,
403             "endOffset": 15,
404             "startLine": 25,
405             "startOffset": 0,
406           },
407           "transitions": Array [],
408           "type": "BUG",
409         },
410       ]
411     }
412     locations={
413       Array [
414         Object {
415           "component": "main.js",
416           "index": 0,
417           "textRange": Object {
418             "endLine": 2,
419             "endOffset": 2,
420             "startLine": 1,
421             "startOffset": 1,
422           },
423         },
424         Object {
425           "component": "main.js",
426           "index": 1,
427           "textRange": Object {
428             "endLine": 2,
429             "endOffset": 2,
430             "startLine": 1,
431             "startOffset": 1,
432           },
433         },
434         Object {
435           "component": "main.js",
436           "index": 2,
437           "textRange": Object {
438             "endLine": 2,
439             "endOffset": 2,
440             "startLine": 1,
441             "startOffset": 1,
442           },
443         },
444       ]
445     }
446     onIssueSelect={[MockFunction]}
447     onLoaded={[Function]}
448     onLocationSelect={[MockFunction]}
449   />
450 </div>
451 `;
452
453 exports[`should render SourceViewer correctly: default 1`] = `
454 <div>
455   <CrossComponentSourceViewer
456     branchLike={
457       Object {
458         "analysisDate": "2018-01-01",
459         "excludedFromPurge": true,
460         "isMain": true,
461         "name": "master",
462       }
463     }
464     issue={
465       Object {
466         "actions": Array [],
467         "component": "main.js",
468         "componentLongName": "main.js",
469         "componentQualifier": "FIL",
470         "componentUuid": "foo1234",
471         "creationDate": "2017-03-01T09:36:01+0100",
472         "flows": Array [],
473         "key": "AVsae-CQS-9G3txfbFN2",
474         "line": 25,
475         "message": "Reduce the number of conditional operators (4) used in the expression",
476         "project": "myproject",
477         "projectKey": "foo",
478         "projectName": "Foo",
479         "rule": "javascript:S1067",
480         "ruleName": "foo",
481         "secondaryLocations": Array [],
482         "severity": "MAJOR",
483         "status": "OPEN",
484         "textRange": Object {
485           "endLine": 26,
486           "endOffset": 15,
487           "startLine": 25,
488           "startOffset": 0,
489         },
490         "transitions": Array [],
491         "type": "BUG",
492       }
493     }
494     issues={
495       Array [
496         Object {
497           "actions": Array [],
498           "component": "main.js",
499           "componentLongName": "main.js",
500           "componentQualifier": "FIL",
501           "componentUuid": "foo1234",
502           "creationDate": "2017-03-01T09:36:01+0100",
503           "flows": Array [],
504           "key": "AVsae-CQS-9G3txfbFN2",
505           "line": 25,
506           "message": "Reduce the number of conditional operators (4) used in the expression",
507           "project": "myproject",
508           "projectKey": "foo",
509           "projectName": "Foo",
510           "rule": "javascript:S1067",
511           "ruleName": "foo",
512           "secondaryLocations": Array [],
513           "severity": "MAJOR",
514           "status": "OPEN",
515           "textRange": Object {
516             "endLine": 26,
517             "endOffset": 15,
518             "startLine": 25,
519             "startOffset": 0,
520           },
521           "transitions": Array [],
522           "type": "BUG",
523         },
524       ]
525     }
526     locations={Array []}
527     onIssueSelect={[MockFunction]}
528     onLoaded={[Function]}
529     onLocationSelect={[MockFunction]}
530   />
531 </div>
532 `;
533
534 exports[`should render SourceViewer correctly: single secondary location 1`] = `
535 <div>
536   <CrossComponentSourceViewer
537     branchLike={
538       Object {
539         "analysisDate": "2018-01-01",
540         "excludedFromPurge": true,
541         "isMain": true,
542         "name": "master",
543       }
544     }
545     issue={
546       Object {
547         "actions": Array [],
548         "component": "main.js",
549         "componentLongName": "main.js",
550         "componentQualifier": "FIL",
551         "componentUuid": "foo1234",
552         "creationDate": "2017-03-01T09:36:01+0100",
553         "flows": Array [
554           Array [
555             Object {
556               "component": "main.js",
557               "index": 0,
558               "textRange": Object {
559                 "endLine": 2,
560                 "endOffset": 2,
561                 "startLine": 1,
562                 "startOffset": 1,
563               },
564             },
565           ],
566         ],
567         "key": "AVsae-CQS-9G3txfbFN2",
568         "line": 25,
569         "message": "Reduce the number of conditional operators (4) used in the expression",
570         "project": "myproject",
571         "projectKey": "foo",
572         "projectName": "Foo",
573         "rule": "javascript:S1067",
574         "ruleName": "foo",
575         "secondaryLocations": Array [
576           Object {
577             "component": "main.js",
578             "textRange": Object {
579               "endLine": 2,
580               "endOffset": 2,
581               "startLine": 1,
582               "startOffset": 1,
583             },
584           },
585           Object {
586             "component": "main.js",
587             "textRange": Object {
588               "endLine": 2,
589               "endOffset": 2,
590               "startLine": 1,
591               "startOffset": 1,
592             },
593           },
594         ],
595         "severity": "MAJOR",
596         "status": "OPEN",
597         "textRange": Object {
598           "endLine": 26,
599           "endOffset": 15,
600           "startLine": 25,
601           "startOffset": 0,
602         },
603         "transitions": Array [],
604         "type": "BUG",
605       }
606     }
607     issues={
608       Array [
609         Object {
610           "actions": Array [],
611           "component": "main.js",
612           "componentLongName": "main.js",
613           "componentQualifier": "FIL",
614           "componentUuid": "foo1234",
615           "creationDate": "2017-03-01T09:36:01+0100",
616           "flows": Array [
617             Array [
618               Object {
619                 "component": "main.js",
620                 "textRange": Object {
621                   "endLine": 2,
622                   "endOffset": 2,
623                   "startLine": 1,
624                   "startOffset": 1,
625                 },
626               },
627               Object {
628                 "component": "main.js",
629                 "textRange": Object {
630                   "endLine": 2,
631                   "endOffset": 2,
632                   "startLine": 1,
633                   "startOffset": 1,
634                 },
635               },
636               Object {
637                 "component": "main.js",
638                 "textRange": Object {
639                   "endLine": 2,
640                   "endOffset": 2,
641                   "startLine": 1,
642                   "startOffset": 1,
643                 },
644               },
645             ],
646             Array [
647               Object {
648                 "component": "main.js",
649                 "textRange": Object {
650                   "endLine": 2,
651                   "endOffset": 2,
652                   "startLine": 1,
653                   "startOffset": 1,
654                 },
655               },
656               Object {
657                 "component": "main.js",
658                 "textRange": Object {
659                   "endLine": 2,
660                   "endOffset": 2,
661                   "startLine": 1,
662                   "startOffset": 1,
663                 },
664               },
665             ],
666           ],
667           "key": "AVsae-CQS-9G3txfbFN2",
668           "line": 25,
669           "message": "Reduce the number of conditional operators (4) used in the expression",
670           "project": "myproject",
671           "projectKey": "foo",
672           "projectName": "Foo",
673           "rule": "javascript:S1067",
674           "ruleName": "foo",
675           "secondaryLocations": Array [
676             Object {
677               "component": "main.js",
678               "textRange": Object {
679                 "endLine": 2,
680                 "endOffset": 2,
681                 "startLine": 1,
682                 "startOffset": 1,
683               },
684             },
685             Object {
686               "component": "main.js",
687               "textRange": Object {
688                 "endLine": 2,
689                 "endOffset": 2,
690                 "startLine": 1,
691                 "startOffset": 1,
692               },
693             },
694           ],
695           "severity": "MAJOR",
696           "status": "OPEN",
697           "textRange": Object {
698             "endLine": 26,
699             "endOffset": 15,
700             "startLine": 25,
701             "startOffset": 0,
702           },
703           "transitions": Array [],
704           "type": "BUG",
705         },
706       ]
707     }
708     locations={
709       Array [
710         Object {
711           "component": "main.js",
712           "index": 0,
713           "textRange": Object {
714             "endLine": 2,
715             "endOffset": 2,
716             "startLine": 1,
717             "startOffset": 1,
718           },
719         },
720       ]
721     }
722     onIssueSelect={[MockFunction]}
723     onLoaded={[Function]}
724     onLocationSelect={[MockFunction]}
725   />
726 </div>
727 `;