]> source.dussan.org Git - sonarqube.git/blob
483ece472725d67f9226bec0622c4c54f812d63b
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly 1`] = `
4 <div
5   id="security_hotspots"
6 >
7   <Suggestions
8     suggestions="security_hotspots"
9   />
10   <Helmet
11     defer={true}
12     encodeSpecialCharacters={true}
13     title="hotspots.page"
14   />
15   <A11ySkipTarget
16     anchor="security_hotspots_main"
17   />
18   <Connect(withCurrentUser(FilterBar))
19     component={
20       Object {
21         "breadcrumbs": Array [],
22         "key": "my-project",
23         "name": "MyProject",
24         "qualifier": "TRK",
25         "qualityGate": Object {
26           "isDefault": true,
27           "key": "30",
28           "name": "Sonar way",
29         },
30         "qualityProfiles": Array [
31           Object {
32             "deleted": false,
33             "key": "my-qp",
34             "language": "ts",
35             "name": "Sonar way",
36           },
37         ],
38         "tags": Array [],
39       }
40     }
41     filters={
42       Object {
43         "assignedToMe": false,
44         "sinceLeakPeriod": false,
45         "status": "TO_REVIEW",
46       }
47     }
48     isStaticListOfHotspots={true}
49     loadingMeasure={false}
50     onBranch={false}
51     onChangeFilters={[MockFunction]}
52     onShowAllHotspots={[MockFunction]}
53   />
54   <EmptyHotspotsPage
55     filtered={false}
56     isStaticListOfHotspots={true}
57   />
58 </div>
59 `;
60
61 exports[`should render correctly when filtered by category or cwe: category 1`] = `
62 <div
63   className="layout-page-side"
64   style={
65     Object {
66       "top": 0,
67     }
68   }
69 >
70   <div
71     className="layout-page-side-inner"
72   >
73     <HotspotSimpleList
74       filterByCategory={
75         Object {
76           "category": "a1",
77           "standard": "owaspTop10",
78         }
79       }
80       hotspots={
81         Array [
82           Object {
83             "author": "Developer 1",
84             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
85             "creationDate": "2013-05-13T17:55:39+0200",
86             "key": "h1",
87             "line": 81,
88             "message": "'3' is a magic number.",
89             "project": "com.github.kevinsawicki:http-request",
90             "resolution": undefined,
91             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
92             "securityCategory": "command-injection",
93             "status": "TO_REVIEW",
94             "updateDate": "2013-05-13T17:55:39+0200",
95             "vulnerabilityProbability": "HIGH",
96           },
97           Object {
98             "author": "Developer 1",
99             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
100             "creationDate": "2013-05-13T17:55:39+0200",
101             "key": "h2",
102             "line": 81,
103             "message": "'3' is a magic number.",
104             "project": "com.github.kevinsawicki:http-request",
105             "resolution": undefined,
106             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
107             "securityCategory": "command-injection",
108             "status": "TO_REVIEW",
109             "updateDate": "2013-05-13T17:55:39+0200",
110             "vulnerabilityProbability": "HIGH",
111           },
112         ]
113       }
114       hotspotsTotal={2}
115       loadingMore={false}
116       onHotspotClick={[MockFunction]}
117       onLoadMore={[MockFunction]}
118       selectedHotspot={
119         Object {
120           "author": "Developer 1",
121           "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
122           "creationDate": "2013-05-13T17:55:39+0200",
123           "key": "h1",
124           "line": 81,
125           "message": "'3' is a magic number.",
126           "project": "com.github.kevinsawicki:http-request",
127           "resolution": undefined,
128           "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
129           "securityCategory": "command-injection",
130           "status": "TO_REVIEW",
131           "updateDate": "2013-05-13T17:55:39+0200",
132           "vulnerabilityProbability": "HIGH",
133         }
134       }
135       standards={
136         Object {
137           "cwe": Object {
138             "1004": Object {
139               "title": "Sensitive Cookie Without 'HttpOnly' Flag",
140             },
141             "unknown": Object {
142               "title": "No CWE associated",
143             },
144           },
145           "owaspTop10": Object {
146             "a1": Object {
147               "title": "Injection",
148             },
149             "a2": Object {
150               "title": "Broken Authentication",
151             },
152             "a3": Object {
153               "title": "Sensitive Data Exposure",
154             },
155           },
156           "sansTop25": Object {
157             "insecure-interaction": Object {
158               "title": "Insecure Interaction Between Components",
159             },
160             "porous-defenses": Object {
161               "title": "Porous Defenses",
162             },
163             "risky-resource": Object {
164               "title": "Risky Resource Management",
165             },
166           },
167           "sonarsourceSecurity": Object {
168             "buffer-overflow": Object {
169               "title": "Buffer Overflow",
170             },
171             "rce": Object {
172               "title": "Code Injection (RCE)",
173             },
174             "sql-injection": Object {
175               "title": "SQL Injection",
176             },
177           },
178         }
179       }
180     />
181   </div>
182 </div>
183 `;
184
185 exports[`should render correctly when filtered by category or cwe: cwe 1`] = `
186 <div
187   className="layout-page-side"
188   style={
189     Object {
190       "top": 0,
191     }
192   }
193 >
194   <div
195     className="layout-page-side-inner"
196   >
197     <HotspotSimpleList
198       filterByCWE="327"
199       hotspots={
200         Array [
201           Object {
202             "author": "Developer 1",
203             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
204             "creationDate": "2013-05-13T17:55:39+0200",
205             "key": "h1",
206             "line": 81,
207             "message": "'3' is a magic number.",
208             "project": "com.github.kevinsawicki:http-request",
209             "resolution": undefined,
210             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
211             "securityCategory": "command-injection",
212             "status": "TO_REVIEW",
213             "updateDate": "2013-05-13T17:55:39+0200",
214             "vulnerabilityProbability": "HIGH",
215           },
216           Object {
217             "author": "Developer 1",
218             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
219             "creationDate": "2013-05-13T17:55:39+0200",
220             "key": "h2",
221             "line": 81,
222             "message": "'3' is a magic number.",
223             "project": "com.github.kevinsawicki:http-request",
224             "resolution": undefined,
225             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
226             "securityCategory": "command-injection",
227             "status": "TO_REVIEW",
228             "updateDate": "2013-05-13T17:55:39+0200",
229             "vulnerabilityProbability": "HIGH",
230           },
231         ]
232       }
233       hotspotsTotal={2}
234       loadingMore={false}
235       onHotspotClick={[MockFunction]}
236       onLoadMore={[MockFunction]}
237       selectedHotspot={
238         Object {
239           "author": "Developer 1",
240           "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
241           "creationDate": "2013-05-13T17:55:39+0200",
242           "key": "h1",
243           "line": 81,
244           "message": "'3' is a magic number.",
245           "project": "com.github.kevinsawicki:http-request",
246           "resolution": undefined,
247           "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
248           "securityCategory": "command-injection",
249           "status": "TO_REVIEW",
250           "updateDate": "2013-05-13T17:55:39+0200",
251           "vulnerabilityProbability": "HIGH",
252         }
253       }
254       standards={
255         Object {
256           "cwe": Object {
257             "1004": Object {
258               "title": "Sensitive Cookie Without 'HttpOnly' Flag",
259             },
260             "unknown": Object {
261               "title": "No CWE associated",
262             },
263           },
264           "owaspTop10": Object {
265             "a1": Object {
266               "title": "Injection",
267             },
268             "a2": Object {
269               "title": "Broken Authentication",
270             },
271             "a3": Object {
272               "title": "Sensitive Data Exposure",
273             },
274           },
275           "sansTop25": Object {
276             "insecure-interaction": Object {
277               "title": "Insecure Interaction Between Components",
278             },
279             "porous-defenses": Object {
280               "title": "Porous Defenses",
281             },
282             "risky-resource": Object {
283               "title": "Risky Resource Management",
284             },
285           },
286           "sonarsourceSecurity": Object {
287             "buffer-overflow": Object {
288               "title": "Buffer Overflow",
289             },
290             "rce": Object {
291               "title": "Code Injection (RCE)",
292             },
293             "sql-injection": Object {
294               "title": "SQL Injection",
295             },
296           },
297         }
298       }
299     />
300   </div>
301 </div>
302 `;
303
304 exports[`should render correctly with hotspots 1`] = `
305 <div
306   id="security_hotspots"
307 >
308   <Suggestions
309     suggestions="security_hotspots"
310   />
311   <Helmet
312     defer={true}
313     encodeSpecialCharacters={true}
314     title="hotspots.page"
315   />
316   <A11ySkipTarget
317     anchor="security_hotspots_main"
318   />
319   <Connect(withCurrentUser(FilterBar))
320     component={
321       Object {
322         "breadcrumbs": Array [],
323         "key": "my-project",
324         "name": "MyProject",
325         "qualifier": "TRK",
326         "qualityGate": Object {
327           "isDefault": true,
328           "key": "30",
329           "name": "Sonar way",
330         },
331         "qualityProfiles": Array [
332           Object {
333             "deleted": false,
334             "key": "my-qp",
335             "language": "ts",
336             "name": "Sonar way",
337           },
338         ],
339         "tags": Array [],
340       }
341     }
342     filters={
343       Object {
344         "assignedToMe": false,
345         "sinceLeakPeriod": false,
346         "status": "TO_REVIEW",
347       }
348     }
349     isStaticListOfHotspots={true}
350     loadingMeasure={false}
351     onBranch={false}
352     onChangeFilters={[MockFunction]}
353     onShowAllHotspots={[MockFunction]}
354   />
355   <EmptyHotspotsPage
356     filtered={false}
357     isStaticListOfHotspots={true}
358   />
359 </div>
360 `;
361
362 exports[`should render correctly with hotspots 2`] = `
363 <div
364   className="layout-page-side"
365   style={
366     Object {
367       "top": 0,
368     }
369   }
370 >
371   <div
372     className="layout-page-side-inner"
373   >
374     <HotspotList
375       hotspots={
376         Array [
377           Object {
378             "author": "Developer 1",
379             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
380             "creationDate": "2013-05-13T17:55:39+0200",
381             "key": "h1",
382             "line": 81,
383             "message": "'3' is a magic number.",
384             "project": "com.github.kevinsawicki:http-request",
385             "resolution": undefined,
386             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
387             "securityCategory": "command-injection",
388             "status": "TO_REVIEW",
389             "updateDate": "2013-05-13T17:55:39+0200",
390             "vulnerabilityProbability": "HIGH",
391           },
392           Object {
393             "author": "Developer 1",
394             "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
395             "creationDate": "2013-05-13T17:55:39+0200",
396             "key": "h2",
397             "line": 81,
398             "message": "'3' is a magic number.",
399             "project": "com.github.kevinsawicki:http-request",
400             "resolution": undefined,
401             "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
402             "securityCategory": "command-injection",
403             "status": "TO_REVIEW",
404             "updateDate": "2013-05-13T17:55:39+0200",
405             "vulnerabilityProbability": "HIGH",
406           },
407         ]
408       }
409       hotspotsTotal={3}
410       isStaticListOfHotspots={true}
411       loadingMore={false}
412       onHotspotClick={[MockFunction]}
413       onLoadMore={[MockFunction]}
414       securityCategories={Object {}}
415       selectedHotspot={
416         Object {
417           "author": "Developer 1",
418           "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
419           "creationDate": "2013-05-13T17:55:39+0200",
420           "key": "h2",
421           "line": 81,
422           "message": "'3' is a magic number.",
423           "project": "com.github.kevinsawicki:http-request",
424           "resolution": undefined,
425           "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
426           "securityCategory": "command-injection",
427           "status": "TO_REVIEW",
428           "updateDate": "2013-05-13T17:55:39+0200",
429           "vulnerabilityProbability": "HIGH",
430         }
431       }
432       statusFilter="TO_REVIEW"
433     />
434   </div>
435 </div>
436 `;
437
438 exports[`should render correctly: loading 1`] = `
439 <div
440   id="security_hotspots"
441 >
442   <Suggestions
443     suggestions="security_hotspots"
444   />
445   <Helmet
446     defer={true}
447     encodeSpecialCharacters={true}
448     title="hotspots.page"
449   />
450   <A11ySkipTarget
451     anchor="security_hotspots_main"
452   />
453   <Connect(withCurrentUser(FilterBar))
454     component={
455       Object {
456         "breadcrumbs": Array [],
457         "key": "my-project",
458         "name": "MyProject",
459         "qualifier": "TRK",
460         "qualityGate": Object {
461           "isDefault": true,
462           "key": "30",
463           "name": "Sonar way",
464         },
465         "qualityProfiles": Array [
466           Object {
467             "deleted": false,
468             "key": "my-qp",
469             "language": "ts",
470             "name": "Sonar way",
471           },
472         ],
473         "tags": Array [],
474       }
475     }
476     filters={
477       Object {
478         "assignedToMe": false,
479         "sinceLeakPeriod": false,
480         "status": "TO_REVIEW",
481       }
482     }
483     isStaticListOfHotspots={true}
484     loadingMeasure={false}
485     onBranch={false}
486     onChangeFilters={[MockFunction]}
487     onShowAllHotspots={[MockFunction]}
488   />
489   <DeferredSpinner
490     className="huge-spacer-left big-spacer-top"
491   />
492 </div>
493 `;
494
495 exports[`should render correctly: no hotspots with filters 1`] = `
496 <div
497   id="security_hotspots"
498 >
499   <Suggestions
500     suggestions="security_hotspots"
501   />
502   <Helmet
503     defer={true}
504     encodeSpecialCharacters={true}
505     title="hotspots.page"
506   />
507   <A11ySkipTarget
508     anchor="security_hotspots_main"
509   />
510   <Connect(withCurrentUser(FilterBar))
511     component={
512       Object {
513         "breadcrumbs": Array [],
514         "key": "my-project",
515         "name": "MyProject",
516         "qualifier": "TRK",
517         "qualityGate": Object {
518           "isDefault": true,
519           "key": "30",
520           "name": "Sonar way",
521         },
522         "qualityProfiles": Array [
523           Object {
524             "deleted": false,
525             "key": "my-qp",
526             "language": "ts",
527             "name": "Sonar way",
528           },
529         ],
530         "tags": Array [],
531       }
532     }
533     filters={
534       Object {
535         "assignedToMe": true,
536         "sinceLeakPeriod": false,
537         "status": "TO_REVIEW",
538       }
539     }
540     isStaticListOfHotspots={true}
541     loadingMeasure={false}
542     onBranch={false}
543     onChangeFilters={[MockFunction]}
544     onShowAllHotspots={[MockFunction]}
545   />
546   <EmptyHotspotsPage
547     filtered={true}
548     isStaticListOfHotspots={true}
549   />
550 </div>
551 `;