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