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