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