]> source.dussan.org Git - sonarqube.git/blob
2604418e147c2e7836b9bcbe42112f91f7509fcc
[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         "fromHotspot": false,
47         "key": "AVsae-CQS-9G3txfbFN2",
48         "line": 25,
49         "message": "Reduce the number of conditional operators (4) used in the expression",
50         "project": "myproject",
51         "projectKey": "foo",
52         "projectName": "Foo",
53         "rule": "javascript:S1067",
54         "ruleName": "foo",
55         "secondaryLocations": Array [
56           Object {
57             "component": "main.js",
58             "textRange": Object {
59               "endLine": 2,
60               "endOffset": 2,
61               "startLine": 1,
62               "startOffset": 1,
63             },
64           },
65           Object {
66             "component": "main.js",
67             "textRange": Object {
68               "endLine": 2,
69               "endOffset": 2,
70               "startLine": 1,
71               "startOffset": 1,
72             },
73           },
74         ],
75         "severity": "MAJOR",
76         "status": "OPEN",
77         "textRange": Object {
78           "endLine": 26,
79           "endOffset": 15,
80           "startLine": 25,
81           "startOffset": 0,
82         },
83         "transitions": Array [],
84         "type": "BUG",
85       }
86     }
87     issues={
88       Array [
89         Object {
90           "actions": Array [],
91           "component": "main.js",
92           "componentLongName": "main.js",
93           "componentQualifier": "FIL",
94           "componentUuid": "foo1234",
95           "creationDate": "2017-03-01T09:36:01+0100",
96           "flows": Array [
97             Array [
98               Object {
99                 "component": "main.js",
100                 "textRange": Object {
101                   "endLine": 2,
102                   "endOffset": 2,
103                   "startLine": 1,
104                   "startOffset": 1,
105                 },
106               },
107               Object {
108                 "component": "main.js",
109                 "textRange": Object {
110                   "endLine": 2,
111                   "endOffset": 2,
112                   "startLine": 1,
113                   "startOffset": 1,
114                 },
115               },
116               Object {
117                 "component": "main.js",
118                 "textRange": Object {
119                   "endLine": 2,
120                   "endOffset": 2,
121                   "startLine": 1,
122                   "startOffset": 1,
123                 },
124               },
125             ],
126             Array [
127               Object {
128                 "component": "main.js",
129                 "textRange": Object {
130                   "endLine": 2,
131                   "endOffset": 2,
132                   "startLine": 1,
133                   "startOffset": 1,
134                 },
135               },
136               Object {
137                 "component": "main.js",
138                 "textRange": Object {
139                   "endLine": 2,
140                   "endOffset": 2,
141                   "startLine": 1,
142                   "startOffset": 1,
143                 },
144               },
145             ],
146           ],
147           "fromHotspot": false,
148           "key": "AVsae-CQS-9G3txfbFN2",
149           "line": 25,
150           "message": "Reduce the number of conditional operators (4) used in the expression",
151           "project": "myproject",
152           "projectKey": "foo",
153           "projectName": "Foo",
154           "rule": "javascript:S1067",
155           "ruleName": "foo",
156           "secondaryLocations": Array [
157             Object {
158               "component": "main.js",
159               "textRange": Object {
160                 "endLine": 2,
161                 "endOffset": 2,
162                 "startLine": 1,
163                 "startOffset": 1,
164               },
165             },
166             Object {
167               "component": "main.js",
168               "textRange": Object {
169                 "endLine": 2,
170                 "endOffset": 2,
171                 "startLine": 1,
172                 "startOffset": 1,
173               },
174             },
175           ],
176           "severity": "MAJOR",
177           "status": "OPEN",
178           "textRange": Object {
179             "endLine": 26,
180             "endOffset": 15,
181             "startLine": 25,
182             "startOffset": 0,
183           },
184           "transitions": Array [],
185           "type": "BUG",
186         },
187       ]
188     }
189     locations={
190       Array [
191         Object {
192           "component": "main.js",
193           "index": 0,
194           "textRange": Object {
195             "endLine": 2,
196             "endOffset": 2,
197             "startLine": 1,
198             "startOffset": 1,
199           },
200         },
201         Object {
202           "component": "main.js",
203           "index": 1,
204           "textRange": Object {
205             "endLine": 12,
206             "endOffset": 2,
207             "startLine": 10,
208             "startOffset": 1,
209           },
210         },
211       ]
212     }
213     onIssueChange={[MockFunction]}
214     onLoaded={[Function]}
215     onLocationSelect={[MockFunction]}
216     scroll={[Function]}
217   />
218 </div>
219 `;
220
221 exports[`should render SourceViewer correctly: all secondary locations on same line 1`] = `
222 <div>
223   <SourceViewer
224     aroundLine={26}
225     branchLike={
226       Object {
227         "analysisDate": "2018-01-01",
228         "excludedFromPurge": true,
229         "isMain": true,
230         "name": "master",
231       }
232     }
233     component="main.js"
234     displayAllIssues={true}
235     displayIssueLocationsCount={true}
236     displayIssueLocationsLink={false}
237     displayLocationMarkers={false}
238     highlightedLocations={
239       Array [
240         Object {
241           "component": "main.js",
242           "index": 0,
243           "textRange": Object {
244             "endLine": 2,
245             "endOffset": 2,
246             "startLine": 1,
247             "startOffset": 1,
248           },
249         },
250         Object {
251           "component": "main.js",
252           "index": 1,
253           "textRange": Object {
254             "endLine": 2,
255             "endOffset": 2,
256             "startLine": 1,
257             "startOffset": 1,
258           },
259         },
260         Object {
261           "component": "main.js",
262           "index": 2,
263           "textRange": Object {
264             "endLine": 2,
265             "endOffset": 2,
266             "startLine": 1,
267             "startOffset": 1,
268           },
269         },
270       ]
271     }
272     loadIssues={[MockFunction]}
273     onIssueChange={[MockFunction]}
274     onIssueSelect={[MockFunction]}
275     onLoaded={[Function]}
276     onLocationSelect={[MockFunction]}
277     scroll={[Function]}
278     selectedIssue="AVsae-CQS-9G3txfbFN2"
279     slimHeader={true}
280   />
281 </div>
282 `;
283
284 exports[`should render SourceViewer correctly: default 1`] = `
285 <div>
286   <SourceViewer
287     aroundLine={26}
288     branchLike={
289       Object {
290         "analysisDate": "2018-01-01",
291         "excludedFromPurge": true,
292         "isMain": true,
293         "name": "master",
294       }
295     }
296     component="main.js"
297     displayAllIssues={true}
298     displayIssueLocationsCount={true}
299     displayIssueLocationsLink={false}
300     displayLocationMarkers={false}
301     highlightedLocations={Array []}
302     loadIssues={[MockFunction]}
303     onIssueChange={[MockFunction]}
304     onIssueSelect={[MockFunction]}
305     onLoaded={[Function]}
306     onLocationSelect={[MockFunction]}
307     scroll={[Function]}
308     selectedIssue="AVsae-CQS-9G3txfbFN2"
309     slimHeader={true}
310   />
311 </div>
312 `;
313
314 exports[`should render SourceViewer correctly: single secondary location 1`] = `
315 <div>
316   <SourceViewer
317     aroundLine={26}
318     branchLike={
319       Object {
320         "analysisDate": "2018-01-01",
321         "excludedFromPurge": true,
322         "isMain": true,
323         "name": "master",
324       }
325     }
326     component="main.js"
327     displayAllIssues={true}
328     displayIssueLocationsCount={true}
329     displayIssueLocationsLink={false}
330     displayLocationMarkers={false}
331     highlightedLocations={
332       Array [
333         Object {
334           "component": "main.js",
335           "index": 0,
336           "textRange": Object {
337             "endLine": 2,
338             "endOffset": 2,
339             "startLine": 1,
340             "startOffset": 1,
341           },
342         },
343       ]
344     }
345     loadIssues={[MockFunction]}
346     onIssueChange={[MockFunction]}
347     onIssueSelect={[MockFunction]}
348     onLoaded={[Function]}
349     onLocationSelect={[MockFunction]}
350     scroll={[Function]}
351     selectedIssue="AVsae-CQS-9G3txfbFN2"
352     slimHeader={true}
353   />
354 </div>
355 `;