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