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