]> source.dussan.org Git - sonarqube.git/blob
38a4c317e8d6b4e476549146abb77ce8aad4b9b3
[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     ariaLabel="code_viewer.loading"
22   />
23 </div>
24 `;
25
26 exports[`should render correctly 2`] = `
27 <Fragment>
28   <ContextProvider
29     key="1-0-0"
30     value={
31       Object {
32         "branchLike": undefined,
33         "file": Object {},
34       }
35     }
36   >
37     <ComponentSourceSnippetGroupViewer
38       duplicationsByLine={Object {}}
39       isLastOccurenceOfPrimaryComponent={false}
40       issue={
41         Object {
42           "actions": Array [],
43           "component": "project:main.js",
44           "componentLongName": "main.js",
45           "componentQualifier": "FIL",
46           "componentUuid": "foo1234",
47           "creationDate": "2017-03-01T09:36:01+0100",
48           "flows": Array [
49             Array [
50               Object {
51                 "component": "main.js",
52                 "textRange": Object {
53                   "endLine": 2,
54                   "endOffset": 2,
55                   "startLine": 1,
56                   "startOffset": 1,
57                 },
58               },
59               Object {
60                 "component": "main.js",
61                 "textRange": Object {
62                   "endLine": 2,
63                   "endOffset": 2,
64                   "startLine": 1,
65                   "startOffset": 1,
66                 },
67               },
68               Object {
69                 "component": "main.js",
70                 "textRange": Object {
71                   "endLine": 2,
72                   "endOffset": 2,
73                   "startLine": 1,
74                   "startOffset": 1,
75                 },
76               },
77             ],
78             Array [
79               Object {
80                 "component": "main.js",
81                 "textRange": Object {
82                   "endLine": 2,
83                   "endOffset": 2,
84                   "startLine": 1,
85                   "startOffset": 1,
86                 },
87               },
88               Object {
89                 "component": "main.js",
90                 "textRange": Object {
91                   "endLine": 2,
92                   "endOffset": 2,
93                   "startLine": 1,
94                   "startOffset": 1,
95                 },
96               },
97             ],
98           ],
99           "flowsWithType": Array [],
100           "key": "1",
101           "line": 25,
102           "message": "Reduce the number of conditional operators (4) used in the expression",
103           "project": "myproject",
104           "projectKey": "foo",
105           "projectName": "Foo",
106           "rule": "javascript:S1067",
107           "ruleName": "foo",
108           "secondaryLocations": Array [
109             Object {
110               "component": "main.js",
111               "textRange": Object {
112                 "endLine": 2,
113                 "endOffset": 2,
114                 "startLine": 1,
115                 "startOffset": 1,
116               },
117             },
118             Object {
119               "component": "main.js",
120               "textRange": Object {
121                 "endLine": 2,
122                 "endOffset": 2,
123                 "startLine": 1,
124                 "startOffset": 1,
125               },
126             },
127           ],
128           "severity": "MAJOR",
129           "status": "OPEN",
130           "textRange": Object {
131             "endLine": 2,
132             "endOffset": 15,
133             "startLine": 1,
134             "startOffset": 0,
135           },
136           "transitions": Array [],
137           "type": "BUG",
138         }
139       }
140       issuesByLine={Object {}}
141       lastSnippetGroup={true}
142       loadDuplications={[Function]}
143       locations={
144         Array [
145           Object {
146             "component": "project:main.js",
147             "index": 0,
148             "textRange": Object {
149               "endLine": 2,
150               "endOffset": 2,
151               "startLine": 1,
152               "startOffset": 1,
153             },
154           },
155         ]
156       }
157       onIssueSelect={[MockFunction]}
158       onLocationSelect={[MockFunction]}
159       renderDuplicationPopup={[Function]}
160       snippetGroup={
161         Object {
162           "component": Object {},
163           "locations": Array [
164             Object {
165               "component": "project:main.js",
166               "index": 0,
167               "textRange": Object {
168                 "endLine": 2,
169                 "endOffset": 2,
170                 "startLine": 1,
171                 "startOffset": 1,
172               },
173             },
174           ],
175           "sources": Array [],
176         }
177       }
178     />
179   </ContextProvider>
180 </Fragment>
181 `;
182
183 exports[`should render correctly: no component found 1`] = `
184 <Fragment>
185   <ContextProvider
186     key="unknown-0-0"
187     value={
188       Object {
189         "branchLike": undefined,
190         "file": Object {},
191       }
192     }
193   >
194     <ComponentSourceSnippetGroupViewer
195       duplicationsByLine={Object {}}
196       isLastOccurenceOfPrimaryComponent={false}
197       issue={
198         Object {
199           "actions": Array [],
200           "component": "test.js",
201           "componentLongName": "main.js",
202           "componentQualifier": "FIL",
203           "componentUuid": "foo1234",
204           "creationDate": "2017-03-01T09:36:01+0100",
205           "flows": Array [
206             Array [
207               Object {
208                 "component": "main.js",
209                 "textRange": Object {
210                   "endLine": 2,
211                   "endOffset": 2,
212                   "startLine": 1,
213                   "startOffset": 1,
214                 },
215               },
216               Object {
217                 "component": "main.js",
218                 "textRange": Object {
219                   "endLine": 2,
220                   "endOffset": 2,
221                   "startLine": 1,
222                   "startOffset": 1,
223                 },
224               },
225               Object {
226                 "component": "main.js",
227                 "textRange": Object {
228                   "endLine": 2,
229                   "endOffset": 2,
230                   "startLine": 1,
231                   "startOffset": 1,
232                 },
233               },
234             ],
235             Array [
236               Object {
237                 "component": "main.js",
238                 "textRange": Object {
239                   "endLine": 2,
240                   "endOffset": 2,
241                   "startLine": 1,
242                   "startOffset": 1,
243                 },
244               },
245               Object {
246                 "component": "main.js",
247                 "textRange": Object {
248                   "endLine": 2,
249                   "endOffset": 2,
250                   "startLine": 1,
251                   "startOffset": 1,
252                 },
253               },
254             ],
255           ],
256           "flowsWithType": Array [],
257           "key": "unknown",
258           "line": 25,
259           "message": "Reduce the number of conditional operators (4) used in the expression",
260           "project": "myproject",
261           "projectKey": "foo",
262           "projectName": "Foo",
263           "rule": "javascript:S1067",
264           "ruleName": "foo",
265           "secondaryLocations": Array [
266             Object {
267               "component": "main.js",
268               "textRange": Object {
269                 "endLine": 2,
270                 "endOffset": 2,
271                 "startLine": 1,
272                 "startOffset": 1,
273               },
274             },
275             Object {
276               "component": "main.js",
277               "textRange": Object {
278                 "endLine": 2,
279                 "endOffset": 2,
280                 "startLine": 1,
281                 "startOffset": 1,
282               },
283             },
284           ],
285           "severity": "MAJOR",
286           "status": "OPEN",
287           "textRange": Object {
288             "endLine": 26,
289             "endOffset": 15,
290             "startLine": 25,
291             "startOffset": 0,
292           },
293           "transitions": Array [],
294           "type": "BUG",
295         }
296       }
297       issuesByLine={Object {}}
298       lastSnippetGroup={false}
299       loadDuplications={[Function]}
300       locations={Array []}
301       onIssueSelect={[MockFunction]}
302       onLocationSelect={[MockFunction]}
303       renderDuplicationPopup={[Function]}
304       snippetGroup={
305         Object {
306           "component": Object {},
307           "locations": Array [],
308           "sources": Array [],
309         }
310       }
311     />
312   </ContextProvider>
313   <ContextProvider
314     key="unknown-0-1"
315     value={
316       Object {
317         "branchLike": undefined,
318         "file": Object {},
319       }
320     }
321   >
322     <ComponentSourceSnippetGroupViewer
323       duplicationsByLine={Object {}}
324       isLastOccurenceOfPrimaryComponent={false}
325       issue={
326         Object {
327           "actions": Array [],
328           "component": "test.js",
329           "componentLongName": "main.js",
330           "componentQualifier": "FIL",
331           "componentUuid": "foo1234",
332           "creationDate": "2017-03-01T09:36:01+0100",
333           "flows": Array [
334             Array [
335               Object {
336                 "component": "main.js",
337                 "textRange": Object {
338                   "endLine": 2,
339                   "endOffset": 2,
340                   "startLine": 1,
341                   "startOffset": 1,
342                 },
343               },
344               Object {
345                 "component": "main.js",
346                 "textRange": Object {
347                   "endLine": 2,
348                   "endOffset": 2,
349                   "startLine": 1,
350                   "startOffset": 1,
351                 },
352               },
353               Object {
354                 "component": "main.js",
355                 "textRange": Object {
356                   "endLine": 2,
357                   "endOffset": 2,
358                   "startLine": 1,
359                   "startOffset": 1,
360                 },
361               },
362             ],
363             Array [
364               Object {
365                 "component": "main.js",
366                 "textRange": Object {
367                   "endLine": 2,
368                   "endOffset": 2,
369                   "startLine": 1,
370                   "startOffset": 1,
371                 },
372               },
373               Object {
374                 "component": "main.js",
375                 "textRange": Object {
376                   "endLine": 2,
377                   "endOffset": 2,
378                   "startLine": 1,
379                   "startOffset": 1,
380                 },
381               },
382             ],
383           ],
384           "flowsWithType": Array [],
385           "key": "unknown",
386           "line": 25,
387           "message": "Reduce the number of conditional operators (4) used in the expression",
388           "project": "myproject",
389           "projectKey": "foo",
390           "projectName": "Foo",
391           "rule": "javascript:S1067",
392           "ruleName": "foo",
393           "secondaryLocations": Array [
394             Object {
395               "component": "main.js",
396               "textRange": Object {
397                 "endLine": 2,
398                 "endOffset": 2,
399                 "startLine": 1,
400                 "startOffset": 1,
401               },
402             },
403             Object {
404               "component": "main.js",
405               "textRange": Object {
406                 "endLine": 2,
407                 "endOffset": 2,
408                 "startLine": 1,
409                 "startOffset": 1,
410               },
411             },
412           ],
413           "severity": "MAJOR",
414           "status": "OPEN",
415           "textRange": Object {
416             "endLine": 26,
417             "endOffset": 15,
418             "startLine": 25,
419             "startOffset": 0,
420           },
421           "transitions": Array [],
422           "type": "BUG",
423         }
424       }
425       issuesByLine={Object {}}
426       lastSnippetGroup={true}
427       loadDuplications={[Function]}
428       locations={
429         Array [
430           Object {
431             "component": "project:main.js",
432             "index": 0,
433             "textRange": Object {
434               "endLine": 2,
435               "endOffset": 2,
436               "startLine": 1,
437               "startOffset": 1,
438             },
439           },
440         ]
441       }
442       onIssueSelect={[MockFunction]}
443       onLocationSelect={[MockFunction]}
444       renderDuplicationPopup={[Function]}
445       snippetGroup={
446         Object {
447           "component": Object {},
448           "locations": Array [
449             Object {
450               "component": "project:main.js",
451               "index": 0,
452               "textRange": Object {
453                 "endLine": 2,
454                 "endOffset": 2,
455                 "startLine": 1,
456                 "startOffset": 1,
457               },
458             },
459           ],
460           "sources": Array [],
461         }
462       }
463     />
464   </ContextProvider>
465 </Fragment>
466 `;