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