]> source.dussan.org Git - sonarqube.git/blob
6e53dad11aa6bf6b090dcc499cb68dc4740e55ca
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should render correctly for a regular file 1`] = `
4 <div
5   className="source-viewer-header display-flex-center"
6 >
7   <div
8     className="flex-1 little-spacer-top"
9   >
10     <div
11       className="component-name"
12     >
13       <div
14         className="component-name-parent"
15       >
16         <a
17           className="link-with-icon"
18           href="/dashboard?id=my-project"
19         >
20           <QualifierIcon
21             qualifier="TRK"
22           />
23            
24           <span>
25             MyProject
26           </span>
27         </a>
28       </div>
29       <div
30         className="component-name-path"
31       >
32         <QualifierIcon
33           qualifier="FIL"
34         />
35          
36         <span>
37           foo/
38         </span>
39         <span
40           className="component-name-file"
41         >
42           bar.ts
43         </span>
44         <span
45           className="nudged-up spacer-left"
46         >
47           <ClipboardIconButton
48             className="button-link link-no-underline"
49             copyValue="foo/bar.ts"
50           />
51         </span>
52       </div>
53     </div>
54   </div>
55   <Dropdown
56     className="source-viewer-header-actions flex-0"
57     overlay={
58       <ul
59         className="menu"
60       >
61         <li>
62           <a
63             className="js-measures"
64             href="#"
65             onClick={[Function]}
66           >
67             component_viewer.show_details
68           </a>
69         </li>
70         <li>
71           <Link
72             className="js-new-window"
73             onlyActiveOnIndex={false}
74             rel="noopener noreferrer"
75             style={Object {}}
76             target="_blank"
77             to={
78               Object {
79                 "pathname": "/code",
80                 "query": Object {
81                   "id": "my-project",
82                   "line": undefined,
83                   "selected": "foo",
84                 },
85               }
86             }
87           >
88             component_viewer.new_window
89           </Link>
90         </li>
91         <li>
92           <a
93             className="js-workspace"
94             href="#"
95             onClick={[Function]}
96           >
97             component_viewer.open_in_workspace
98           </a>
99         </li>
100         <li>
101           <a
102             className="js-raw-source"
103             href="/api/sources/raw?key=foo"
104             rel="noopener noreferrer"
105             target="_blank"
106           >
107             component_viewer.show_raw_source
108           </a>
109         </li>
110       </ul>
111     }
112     overlayPlacement="bottom-right"
113   >
114     <ButtonIcon
115       className="js-actions"
116     >
117       <ListIcon />
118     </ButtonIcon>
119   </Dropdown>
120 </div>
121 `;
122
123 exports[`should render correctly for a unit test 1`] = `
124 <div
125   className="source-viewer-header display-flex-center"
126 >
127   <div
128     className="flex-1 little-spacer-top"
129   >
130     <div
131       className="component-name"
132     >
133       <div
134         className="component-name-parent"
135       >
136         <a
137           className="link-with-icon"
138           href="/dashboard?id=my-project"
139         >
140           <QualifierIcon
141             qualifier="TRK"
142           />
143            
144           <span>
145             MyProject
146           </span>
147         </a>
148       </div>
149       <div
150         className="component-name-path"
151       >
152         <QualifierIcon
153           qualifier="UTS"
154         />
155          
156         <span>
157           foo/
158         </span>
159         <span
160           className="component-name-file"
161         >
162           bar.ts
163         </span>
164         <span
165           className="nudged-up spacer-left"
166         >
167           <ClipboardIconButton
168             className="button-link link-no-underline"
169             copyValue="foo/bar.ts"
170           />
171         </span>
172       </div>
173     </div>
174   </div>
175   <div
176     className="display-flex-center"
177   >
178     <div
179       className="source-viewer-header-measure"
180     >
181       <span
182         className="source-viewer-header-measure-label"
183       >
184         metric.tests.name
185       </span>
186       <span
187         className="source-viewer-header-measure-value"
188       >
189         12
190       </span>
191     </div>
192   </div>
193   <Dropdown
194     className="source-viewer-header-actions flex-0"
195     overlay={
196       <ul
197         className="menu"
198       >
199         <li>
200           <a
201             className="js-measures"
202             href="#"
203             onClick={[Function]}
204           >
205             component_viewer.show_details
206           </a>
207         </li>
208         <li>
209           <Link
210             className="js-new-window"
211             onlyActiveOnIndex={false}
212             rel="noopener noreferrer"
213             style={Object {}}
214             target="_blank"
215             to={
216               Object {
217                 "pathname": "/code",
218                 "query": Object {
219                   "id": "my-project",
220                   "line": undefined,
221                   "selected": "foo",
222                 },
223               }
224             }
225           >
226             component_viewer.new_window
227           </Link>
228         </li>
229         <li>
230           <a
231             className="js-workspace"
232             href="#"
233             onClick={[Function]}
234           >
235             component_viewer.open_in_workspace
236           </a>
237         </li>
238         <li>
239           <a
240             className="js-raw-source"
241             href="/api/sources/raw?key=foo"
242             rel="noopener noreferrer"
243             target="_blank"
244           >
245             component_viewer.show_raw_source
246           </a>
247         </li>
248       </ul>
249     }
250     overlayPlacement="bottom-right"
251   >
252     <ButtonIcon
253       className="js-actions"
254     >
255       <ListIcon />
256     </ButtonIcon>
257   </Dropdown>
258 </div>
259 `;
260
261 exports[`should render correctly if issue details are passed 1`] = `
262 <div
263   className="source-viewer-header display-flex-center"
264 >
265   <div
266     className="flex-1 little-spacer-top"
267   >
268     <div
269       className="component-name"
270     >
271       <div
272         className="component-name-parent"
273       >
274         <a
275           className="link-with-icon"
276           href="/dashboard?id=my-project"
277         >
278           <QualifierIcon
279             qualifier="TRK"
280           />
281            
282           <span>
283             MyProject
284           </span>
285         </a>
286       </div>
287       <div
288         className="component-name-path"
289       >
290         <QualifierIcon
291           qualifier="FIL"
292         />
293          
294         <span>
295           foo/
296         </span>
297         <span
298           className="component-name-file"
299         >
300           bar.ts
301         </span>
302         <span
303           className="nudged-up spacer-left"
304         >
305           <ClipboardIconButton
306             className="button-link link-no-underline"
307             copyValue="foo/bar.ts"
308           />
309         </span>
310       </div>
311     </div>
312   </div>
313   <div
314     className="display-flex-center"
315   >
316     <div
317       className="source-viewer-header-measure"
318     >
319       <span
320         className="source-viewer-header-measure-label"
321       >
322         metric.lines.name
323       </span>
324       <span
325         className="source-viewer-header-measure-value"
326       >
327         56
328       </span>
329     </div>
330     <div
331       className="source-viewer-header-measure"
332     >
333       <span
334         className="source-viewer-header-measure-label"
335       >
336         metric.coverage.name
337       </span>
338       <span
339         className="source-viewer-header-measure-value"
340       >
341         85.2%
342       </span>
343     </div>
344     <div
345       className="source-viewer-header-measure"
346     >
347       <span
348         className="source-viewer-header-measure-label"
349       >
350         duplications
351       </span>
352       <span
353         className="source-viewer-header-measure-value"
354       >
355         1.0%
356       </span>
357     </div>
358     <div
359       className="source-viewer-header-measure-separator"
360     />
361     <div
362       className="source-viewer-header-measure"
363       key="BUG"
364     >
365       <span
366         className="source-viewer-header-measure-label"
367       >
368         issue.type.BUG
369       </span>
370       <span
371         className="source-viewer-header-measure-value"
372       >
373         <Link
374           onlyActiveOnIndex={false}
375           style={Object {}}
376           to={
377             Object {
378               "pathname": "/project/issues",
379               "query": Object {
380                 "files": "foo/bar.ts",
381                 "id": "my-project",
382                 "resolved": "false",
383                 "types": "BUG",
384               },
385             }
386           }
387         >
388           0
389         </Link>
390       </span>
391     </div>
392     <div
393       className="source-viewer-header-measure"
394       key="VULNERABILITY"
395     >
396       <span
397         className="source-viewer-header-measure-label"
398       >
399         issue.type.VULNERABILITY
400       </span>
401       <span
402         className="source-viewer-header-measure-value"
403       >
404         <Link
405           onlyActiveOnIndex={false}
406           style={Object {}}
407           to={
408             Object {
409               "pathname": "/project/issues",
410               "query": Object {
411                 "files": "foo/bar.ts",
412                 "id": "my-project",
413                 "resolved": "false",
414                 "types": "VULNERABILITY",
415               },
416             }
417           }
418         >
419           2
420         </Link>
421       </span>
422     </div>
423     <div
424       className="source-viewer-header-measure"
425       key="CODE_SMELL"
426     >
427       <span
428         className="source-viewer-header-measure-label"
429       >
430         issue.type.CODE_SMELL
431       </span>
432       <span
433         className="source-viewer-header-measure-value"
434       >
435         <Link
436           onlyActiveOnIndex={false}
437           style={Object {}}
438           to={
439             Object {
440               "pathname": "/project/issues",
441               "query": Object {
442                 "files": "foo/bar.ts",
443                 "id": "my-project",
444                 "resolved": "false",
445                 "types": "CODE_SMELL",
446               },
447             }
448           }
449         >
450           1
451         </Link>
452       </span>
453     </div>
454     <div
455       className="source-viewer-header-measure"
456       key="SECURITY_HOTSPOT"
457     >
458       <span
459         className="source-viewer-header-measure-label"
460       >
461         issue.type.SECURITY_HOTSPOT
462       </span>
463       <span
464         className="source-viewer-header-measure-value"
465       >
466         <Link
467           onlyActiveOnIndex={false}
468           style={Object {}}
469           to={
470             Object {
471               "pathname": "/project/issues",
472               "query": Object {
473                 "files": "foo/bar.ts",
474                 "id": "my-project",
475                 "resolved": "false",
476                 "types": "SECURITY_HOTSPOT",
477               },
478             }
479           }
480         >
481           2
482         </Link>
483       </span>
484     </div>
485   </div>
486   <Dropdown
487     className="source-viewer-header-actions flex-0"
488     overlay={
489       <ul
490         className="menu"
491       >
492         <li>
493           <a
494             className="js-measures"
495             href="#"
496             onClick={[Function]}
497           >
498             component_viewer.show_details
499           </a>
500         </li>
501         <li>
502           <Link
503             className="js-new-window"
504             onlyActiveOnIndex={false}
505             rel="noopener noreferrer"
506             style={Object {}}
507             target="_blank"
508             to={
509               Object {
510                 "pathname": "/code",
511                 "query": Object {
512                   "id": "my-project",
513                   "line": undefined,
514                   "selected": "foo",
515                 },
516               }
517             }
518           >
519             component_viewer.new_window
520           </Link>
521         </li>
522         <li>
523           <a
524             className="js-workspace"
525             href="#"
526             onClick={[Function]}
527           >
528             component_viewer.open_in_workspace
529           </a>
530         </li>
531         <li>
532           <a
533             className="js-raw-source"
534             href="/api/sources/raw?key=foo"
535             rel="noopener noreferrer"
536             target="_blank"
537           >
538             component_viewer.show_raw_source
539           </a>
540         </li>
541       </ul>
542     }
543     overlayPlacement="bottom-right"
544   >
545     <ButtonIcon
546       className="js-actions"
547     >
548       <ListIcon />
549     </ButtonIcon>
550   </Dropdown>
551 </div>
552 `;