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