]> source.dussan.org Git - sonarqube.git/blob
17f3c6d788756b80600eb04780976b0637c5a1f7
[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     onLocationSelect={[MockFunction]}
213   />
214 </div>
215 `;
216
217 exports[`should render SourceViewer correctly: all secondary locations on same line 1`] = `
218 <div>
219   <CrossComponentSourceViewer
220     branchLike={
221       Object {
222         "analysisDate": "2018-01-01",
223         "excludedFromPurge": true,
224         "isMain": true,
225         "name": "master",
226       }
227     }
228     issue={
229       Object {
230         "actions": Array [],
231         "component": "main.js",
232         "componentLongName": "main.js",
233         "componentQualifier": "FIL",
234         "componentUuid": "foo1234",
235         "creationDate": "2017-03-01T09:36:01+0100",
236         "flows": Array [
237           Array [
238             Object {
239               "component": "main.js",
240               "index": 0,
241               "textRange": Object {
242                 "endLine": 2,
243                 "endOffset": 2,
244                 "startLine": 1,
245                 "startOffset": 1,
246               },
247             },
248             Object {
249               "component": "main.js",
250               "index": 1,
251               "textRange": Object {
252                 "endLine": 2,
253                 "endOffset": 2,
254                 "startLine": 1,
255                 "startOffset": 1,
256               },
257             },
258             Object {
259               "component": "main.js",
260               "index": 2,
261               "textRange": Object {
262                 "endLine": 2,
263                 "endOffset": 2,
264                 "startLine": 1,
265                 "startOffset": 1,
266               },
267             },
268           ],
269         ],
270         "key": "AVsae-CQS-9G3txfbFN2",
271         "line": 25,
272         "message": "Reduce the number of conditional operators (4) used in the expression",
273         "project": "myproject",
274         "projectKey": "foo",
275         "projectName": "Foo",
276         "rule": "javascript:S1067",
277         "ruleName": "foo",
278         "secondaryLocations": Array [
279           Object {
280             "component": "main.js",
281             "textRange": Object {
282               "endLine": 2,
283               "endOffset": 2,
284               "startLine": 1,
285               "startOffset": 1,
286             },
287           },
288           Object {
289             "component": "main.js",
290             "textRange": Object {
291               "endLine": 2,
292               "endOffset": 2,
293               "startLine": 1,
294               "startOffset": 1,
295             },
296           },
297         ],
298         "severity": "MAJOR",
299         "status": "OPEN",
300         "textRange": Object {
301           "endLine": 26,
302           "endOffset": 15,
303           "startLine": 25,
304           "startOffset": 0,
305         },
306         "transitions": Array [],
307         "type": "BUG",
308       }
309     }
310     issues={
311       Array [
312         Object {
313           "actions": Array [],
314           "component": "main.js",
315           "componentLongName": "main.js",
316           "componentQualifier": "FIL",
317           "componentUuid": "foo1234",
318           "creationDate": "2017-03-01T09:36:01+0100",
319           "flows": Array [
320             Array [
321               Object {
322                 "component": "main.js",
323                 "textRange": Object {
324                   "endLine": 2,
325                   "endOffset": 2,
326                   "startLine": 1,
327                   "startOffset": 1,
328                 },
329               },
330               Object {
331                 "component": "main.js",
332                 "textRange": Object {
333                   "endLine": 2,
334                   "endOffset": 2,
335                   "startLine": 1,
336                   "startOffset": 1,
337                 },
338               },
339               Object {
340                 "component": "main.js",
341                 "textRange": Object {
342                   "endLine": 2,
343                   "endOffset": 2,
344                   "startLine": 1,
345                   "startOffset": 1,
346                 },
347               },
348             ],
349             Array [
350               Object {
351                 "component": "main.js",
352                 "textRange": Object {
353                   "endLine": 2,
354                   "endOffset": 2,
355                   "startLine": 1,
356                   "startOffset": 1,
357                 },
358               },
359               Object {
360                 "component": "main.js",
361                 "textRange": Object {
362                   "endLine": 2,
363                   "endOffset": 2,
364                   "startLine": 1,
365                   "startOffset": 1,
366                 },
367               },
368             ],
369           ],
370           "key": "AVsae-CQS-9G3txfbFN2",
371           "line": 25,
372           "message": "Reduce the number of conditional operators (4) used in the expression",
373           "project": "myproject",
374           "projectKey": "foo",
375           "projectName": "Foo",
376           "rule": "javascript:S1067",
377           "ruleName": "foo",
378           "secondaryLocations": Array [
379             Object {
380               "component": "main.js",
381               "textRange": Object {
382                 "endLine": 2,
383                 "endOffset": 2,
384                 "startLine": 1,
385                 "startOffset": 1,
386               },
387             },
388             Object {
389               "component": "main.js",
390               "textRange": Object {
391                 "endLine": 2,
392                 "endOffset": 2,
393                 "startLine": 1,
394                 "startOffset": 1,
395               },
396             },
397           ],
398           "severity": "MAJOR",
399           "status": "OPEN",
400           "textRange": Object {
401             "endLine": 26,
402             "endOffset": 15,
403             "startLine": 25,
404             "startOffset": 0,
405           },
406           "transitions": Array [],
407           "type": "BUG",
408         },
409       ]
410     }
411     locations={
412       Array [
413         Object {
414           "component": "main.js",
415           "index": 0,
416           "textRange": Object {
417             "endLine": 2,
418             "endOffset": 2,
419             "startLine": 1,
420             "startOffset": 1,
421           },
422         },
423         Object {
424           "component": "main.js",
425           "index": 1,
426           "textRange": Object {
427             "endLine": 2,
428             "endOffset": 2,
429             "startLine": 1,
430             "startOffset": 1,
431           },
432         },
433         Object {
434           "component": "main.js",
435           "index": 2,
436           "textRange": Object {
437             "endLine": 2,
438             "endOffset": 2,
439             "startLine": 1,
440             "startOffset": 1,
441           },
442         },
443       ]
444     }
445     onIssueSelect={[MockFunction]}
446     onLocationSelect={[MockFunction]}
447   />
448 </div>
449 `;
450
451 exports[`should render SourceViewer correctly: default 1`] = `
452 <div>
453   <CrossComponentSourceViewer
454     branchLike={
455       Object {
456         "analysisDate": "2018-01-01",
457         "excludedFromPurge": true,
458         "isMain": true,
459         "name": "master",
460       }
461     }
462     issue={
463       Object {
464         "actions": Array [],
465         "component": "main.js",
466         "componentLongName": "main.js",
467         "componentQualifier": "FIL",
468         "componentUuid": "foo1234",
469         "creationDate": "2017-03-01T09:36:01+0100",
470         "flows": Array [],
471         "key": "AVsae-CQS-9G3txfbFN2",
472         "line": 25,
473         "message": "Reduce the number of conditional operators (4) used in the expression",
474         "project": "myproject",
475         "projectKey": "foo",
476         "projectName": "Foo",
477         "rule": "javascript:S1067",
478         "ruleName": "foo",
479         "secondaryLocations": Array [],
480         "severity": "MAJOR",
481         "status": "OPEN",
482         "textRange": Object {
483           "endLine": 26,
484           "endOffset": 15,
485           "startLine": 25,
486           "startOffset": 0,
487         },
488         "transitions": Array [],
489         "type": "BUG",
490       }
491     }
492     issues={
493       Array [
494         Object {
495           "actions": Array [],
496           "component": "main.js",
497           "componentLongName": "main.js",
498           "componentQualifier": "FIL",
499           "componentUuid": "foo1234",
500           "creationDate": "2017-03-01T09:36:01+0100",
501           "flows": Array [],
502           "key": "AVsae-CQS-9G3txfbFN2",
503           "line": 25,
504           "message": "Reduce the number of conditional operators (4) used in the expression",
505           "project": "myproject",
506           "projectKey": "foo",
507           "projectName": "Foo",
508           "rule": "javascript:S1067",
509           "ruleName": "foo",
510           "secondaryLocations": Array [],
511           "severity": "MAJOR",
512           "status": "OPEN",
513           "textRange": Object {
514             "endLine": 26,
515             "endOffset": 15,
516             "startLine": 25,
517             "startOffset": 0,
518           },
519           "transitions": Array [],
520           "type": "BUG",
521         },
522       ]
523     }
524     locations={Array []}
525     onIssueSelect={[MockFunction]}
526     onLocationSelect={[MockFunction]}
527   />
528 </div>
529 `;
530
531 exports[`should render SourceViewer correctly: single secondary location 1`] = `
532 <div>
533   <CrossComponentSourceViewer
534     branchLike={
535       Object {
536         "analysisDate": "2018-01-01",
537         "excludedFromPurge": true,
538         "isMain": true,
539         "name": "master",
540       }
541     }
542     issue={
543       Object {
544         "actions": Array [],
545         "component": "main.js",
546         "componentLongName": "main.js",
547         "componentQualifier": "FIL",
548         "componentUuid": "foo1234",
549         "creationDate": "2017-03-01T09:36:01+0100",
550         "flows": Array [
551           Array [
552             Object {
553               "component": "main.js",
554               "index": 0,
555               "textRange": Object {
556                 "endLine": 2,
557                 "endOffset": 2,
558                 "startLine": 1,
559                 "startOffset": 1,
560               },
561             },
562           ],
563         ],
564         "key": "AVsae-CQS-9G3txfbFN2",
565         "line": 25,
566         "message": "Reduce the number of conditional operators (4) used in the expression",
567         "project": "myproject",
568         "projectKey": "foo",
569         "projectName": "Foo",
570         "rule": "javascript:S1067",
571         "ruleName": "foo",
572         "secondaryLocations": Array [
573           Object {
574             "component": "main.js",
575             "textRange": Object {
576               "endLine": 2,
577               "endOffset": 2,
578               "startLine": 1,
579               "startOffset": 1,
580             },
581           },
582           Object {
583             "component": "main.js",
584             "textRange": Object {
585               "endLine": 2,
586               "endOffset": 2,
587               "startLine": 1,
588               "startOffset": 1,
589             },
590           },
591         ],
592         "severity": "MAJOR",
593         "status": "OPEN",
594         "textRange": Object {
595           "endLine": 26,
596           "endOffset": 15,
597           "startLine": 25,
598           "startOffset": 0,
599         },
600         "transitions": Array [],
601         "type": "BUG",
602       }
603     }
604     issues={
605       Array [
606         Object {
607           "actions": Array [],
608           "component": "main.js",
609           "componentLongName": "main.js",
610           "componentQualifier": "FIL",
611           "componentUuid": "foo1234",
612           "creationDate": "2017-03-01T09:36:01+0100",
613           "flows": Array [
614             Array [
615               Object {
616                 "component": "main.js",
617                 "textRange": Object {
618                   "endLine": 2,
619                   "endOffset": 2,
620                   "startLine": 1,
621                   "startOffset": 1,
622                 },
623               },
624               Object {
625                 "component": "main.js",
626                 "textRange": Object {
627                   "endLine": 2,
628                   "endOffset": 2,
629                   "startLine": 1,
630                   "startOffset": 1,
631                 },
632               },
633               Object {
634                 "component": "main.js",
635                 "textRange": Object {
636                   "endLine": 2,
637                   "endOffset": 2,
638                   "startLine": 1,
639                   "startOffset": 1,
640                 },
641               },
642             ],
643             Array [
644               Object {
645                 "component": "main.js",
646                 "textRange": Object {
647                   "endLine": 2,
648                   "endOffset": 2,
649                   "startLine": 1,
650                   "startOffset": 1,
651                 },
652               },
653               Object {
654                 "component": "main.js",
655                 "textRange": Object {
656                   "endLine": 2,
657                   "endOffset": 2,
658                   "startLine": 1,
659                   "startOffset": 1,
660                 },
661               },
662             ],
663           ],
664           "key": "AVsae-CQS-9G3txfbFN2",
665           "line": 25,
666           "message": "Reduce the number of conditional operators (4) used in the expression",
667           "project": "myproject",
668           "projectKey": "foo",
669           "projectName": "Foo",
670           "rule": "javascript:S1067",
671           "ruleName": "foo",
672           "secondaryLocations": Array [
673             Object {
674               "component": "main.js",
675               "textRange": Object {
676                 "endLine": 2,
677                 "endOffset": 2,
678                 "startLine": 1,
679                 "startOffset": 1,
680               },
681             },
682             Object {
683               "component": "main.js",
684               "textRange": Object {
685                 "endLine": 2,
686                 "endOffset": 2,
687                 "startLine": 1,
688                 "startOffset": 1,
689               },
690             },
691           ],
692           "severity": "MAJOR",
693           "status": "OPEN",
694           "textRange": Object {
695             "endLine": 26,
696             "endOffset": 15,
697             "startLine": 25,
698             "startOffset": 0,
699           },
700           "transitions": Array [],
701           "type": "BUG",
702         },
703       ]
704     }
705     locations={
706       Array [
707         Object {
708           "component": "main.js",
709           "index": 0,
710           "textRange": Object {
711             "endLine": 2,
712             "endOffset": 2,
713             "startLine": 1,
714             "startOffset": 1,
715           },
716         },
717       ]
718     }
719     onIssueSelect={[MockFunction]}
720     onLocationSelect={[MockFunction]}
721   />
722 </div>
723 `;