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