]> source.dussan.org Git - sonarqube.git/blob
66d782641f1b1c6c003622f9a6fb2dd956caaac2
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should display action state correctly 1`] = `
4 <div>
5   <header
6     className="page-header"
7   >
8     <h1
9       className="page-title"
10     >
11       settings.pr_decoration.binding.title
12     </h1>
13   </header>
14   <div
15     className="markdown small spacer-top big-spacer-bottom"
16   >
17     settings.pr_decoration.binding.description
18   </div>
19   <form
20     onSubmit={[Function]}
21   >
22     <div
23       className="form-field"
24     >
25       <label
26         htmlFor="name"
27       >
28         settings.pr_decoration.binding.form.name
29         <em
30           className="mandatory spacer-right"
31         >
32           *
33         </em>
34       </label>
35       <Select
36         autosize={true}
37         className="abs-width-400"
38         clearable={false}
39         id="name"
40         menuContainerStyle={
41           Object {
42             "maxWidth": "210%",
43             "width": "auto",
44           }
45         }
46         onChange={[Function]}
47         optionRenderer={[Function]}
48         options={
49           Array [
50             Object {
51               "alm": "github",
52               "key": "key",
53               "url": "http://url.com",
54             },
55           ]
56         }
57         searchable={false}
58         value=""
59         valueKey="key"
60         valueRenderer={[Function]}
61       />
62     </div>
63     <div
64       className="display-flex-center"
65     >
66       <DeferredSpinner
67         className="spacer-right"
68         loading={true}
69         timeout={100}
70       />
71     </div>
72   </form>
73 </div>
74 `;
75
76 exports[`should display action state correctly 2`] = `
77 <div>
78   <header
79     className="page-header"
80   >
81     <h1
82       className="page-title"
83     >
84       settings.pr_decoration.binding.title
85     </h1>
86   </header>
87   <div
88     className="markdown small spacer-top big-spacer-bottom"
89   >
90     settings.pr_decoration.binding.description
91   </div>
92   <form
93     onSubmit={[Function]}
94   >
95     <div
96       className="form-field"
97     >
98       <label
99         htmlFor="name"
100       >
101         settings.pr_decoration.binding.form.name
102         <em
103           className="mandatory spacer-right"
104         >
105           *
106         </em>
107       </label>
108       <Select
109         autosize={true}
110         className="abs-width-400"
111         clearable={false}
112         id="name"
113         menuContainerStyle={
114           Object {
115             "maxWidth": "210%",
116             "width": "auto",
117           }
118         }
119         onChange={[Function]}
120         optionRenderer={[Function]}
121         options={
122           Array [
123             Object {
124               "alm": "github",
125               "key": "key",
126               "url": "http://url.com",
127             },
128           ]
129         }
130         searchable={false}
131         value=""
132         valueKey="key"
133         valueRenderer={[Function]}
134       />
135     </div>
136     <div
137       className="display-flex-center"
138     >
139       <DeferredSpinner
140         className="spacer-right"
141         loading={false}
142         timeout={100}
143       />
144       <span
145         className="text-success"
146       >
147         <AlertSuccessIcon
148           className="spacer-right"
149         />
150         settings.state.saved
151       </span>
152     </div>
153   </form>
154 </div>
155 `;
156
157 exports[`should display action state correctly 3`] = `
158 <div>
159   <header
160     className="page-header"
161   >
162     <h1
163       className="page-title"
164     >
165       settings.pr_decoration.binding.title
166     </h1>
167   </header>
168   <div
169     className="markdown small spacer-top big-spacer-bottom"
170   >
171     settings.pr_decoration.binding.description
172   </div>
173   <form
174     onSubmit={[Function]}
175   >
176     <div
177       className="form-field"
178     >
179       <label
180         htmlFor="name"
181       >
182         settings.pr_decoration.binding.form.name
183         <em
184           className="mandatory spacer-right"
185         >
186           *
187         </em>
188       </label>
189       <Select
190         autosize={true}
191         className="abs-width-400"
192         clearable={false}
193         id="name"
194         menuContainerStyle={
195           Object {
196             "maxWidth": "210%",
197             "width": "auto",
198           }
199         }
200         onChange={[Function]}
201         optionRenderer={[Function]}
202         options={
203           Array [
204             Object {
205               "alm": "github",
206               "key": "key",
207               "url": "http://url.com",
208             },
209           ]
210         }
211         searchable={false}
212         value=""
213         valueKey="key"
214         valueRenderer={[Function]}
215       />
216     </div>
217     <div
218       className="display-flex-center"
219     >
220       <DeferredSpinner
221         className="spacer-right"
222         loading={false}
223         timeout={100}
224       />
225     </div>
226   </form>
227 </div>
228 `;
229
230 exports[`should render correctly 1`] = `
231 <DeferredSpinner
232   timeout={100}
233 />
234 `;
235
236 exports[`should render correctly 2`] = `
237 <div>
238   <Alert
239     className="spacer-top huge-spacer-bottom"
240     variant="info"
241   >
242     <FormattedMessage
243       defaultMessage="settings.pr_decoration.binding.no_bindings"
244       id="settings.pr_decoration.binding.no_bindings"
245       values={
246         Object {
247           "link": <Link
248             onlyActiveOnIndex={false}
249             style={Object {}}
250             to="/documentation/analysis/pull-request/#pr-decoration"
251           >
252             learn_more
253           </Link>,
254         }
255       }
256     />
257   </Alert>
258 </div>
259 `;
260
261 exports[`should render multiple instances correctly 1`] = `
262 <div>
263   <header
264     className="page-header"
265   >
266     <h1
267       className="page-title"
268     >
269       settings.pr_decoration.binding.title
270     </h1>
271   </header>
272   <div
273     className="markdown small spacer-top big-spacer-bottom"
274   >
275     settings.pr_decoration.binding.description
276   </div>
277   <form
278     onSubmit={[Function]}
279   >
280     <div
281       className="form-field"
282     >
283       <label
284         htmlFor="name"
285       >
286         settings.pr_decoration.binding.form.name
287         <em
288           className="mandatory spacer-right"
289         >
290           *
291         </em>
292       </label>
293       <Select
294         autosize={true}
295         className="abs-width-400"
296         clearable={false}
297         id="name"
298         menuContainerStyle={
299           Object {
300             "maxWidth": "210%",
301             "width": "auto",
302           }
303         }
304         onChange={[Function]}
305         optionRenderer={[Function]}
306         options={
307           Array [
308             Object {
309               "alm": "github",
310               "key": "i1",
311               "url": "http://github.enterprise.com",
312             },
313             Object {
314               "alm": "github",
315               "key": "i2",
316               "url": "http://github.enterprise.com",
317             },
318             Object {
319               "alm": "bitbucket",
320               "key": "i3",
321               "url": "http://bbs.enterprise.com",
322             },
323             Object {
324               "alm": "azure",
325               "key": "i4",
326             },
327           ]
328         }
329         searchable={false}
330         value=""
331         valueKey="key"
332         valueRenderer={[Function]}
333       />
334     </div>
335     <div
336       className="display-flex-center"
337     >
338       <DeferredSpinner
339         className="spacer-right"
340         loading={false}
341         timeout={100}
342       />
343     </div>
344   </form>
345 </div>
346 `;
347
348 exports[`should render multiple instances correctly 2`] = `
349 <div>
350   <header
351     className="page-header"
352   >
353     <h1
354       className="page-title"
355     >
356       settings.pr_decoration.binding.title
357     </h1>
358   </header>
359   <div
360     className="markdown small spacer-top big-spacer-bottom"
361   >
362     settings.pr_decoration.binding.description
363   </div>
364   <form
365     onSubmit={[Function]}
366   >
367     <div
368       className="form-field"
369     >
370       <label
371         htmlFor="name"
372       >
373         settings.pr_decoration.binding.form.name
374         <em
375           className="mandatory spacer-right"
376         >
377           *
378         </em>
379       </label>
380       <Select
381         autosize={true}
382         className="abs-width-400"
383         clearable={false}
384         id="name"
385         menuContainerStyle={
386           Object {
387             "maxWidth": "210%",
388             "width": "auto",
389           }
390         }
391         onChange={[Function]}
392         optionRenderer={[Function]}
393         options={
394           Array [
395             Object {
396               "alm": "github",
397               "key": "i1",
398               "url": "http://github.enterprise.com",
399             },
400             Object {
401               "alm": "github",
402               "key": "i2",
403               "url": "http://github.enterprise.com",
404             },
405             Object {
406               "alm": "bitbucket",
407               "key": "i3",
408               "url": "http://bbs.enterprise.com",
409             },
410             Object {
411               "alm": "azure",
412               "key": "i4",
413             },
414           ]
415         }
416         searchable={false}
417         value="i1"
418         valueKey="key"
419         valueRenderer={[Function]}
420       />
421     </div>
422     <div
423       className="form-field"
424     >
425       <label
426         className="display-flex-center"
427         htmlFor="github.repository"
428       >
429         settings.pr_decoration.binding.form.github.repository
430         <em
431           className="mandatory"
432         >
433           *
434         </em>
435         <HelpTooltip
436           className="spacer-left"
437           overlay={
438             <FormattedMessage
439               defaultMessage="settings.pr_decoration.binding.form.github.repository.help"
440               id="settings.pr_decoration.binding.form.github.repository.help"
441               values={
442                 Object {
443                   "example": "SonarSource/sonarqube",
444                 }
445               }
446             />
447           }
448           placement="right"
449         />
450       </label>
451       <input
452         className="input-super-large"
453         id="github.repository"
454         maxLength={256}
455         name="github.repository"
456         onChange={[Function]}
457         type="text"
458         value="account/repo"
459       />
460     </div>
461     <div
462       className="display-flex-center"
463     >
464       <DeferredSpinner
465         className="spacer-right"
466         loading={false}
467         timeout={100}
468       />
469       <Button
470         className="spacer-right"
471         onClick={[MockFunction]}
472       >
473         <span
474           data-test="project-settings__alm-reset"
475         >
476           reset_verb
477         </span>
478       </Button>
479     </div>
480   </form>
481 </div>
482 `;
483
484 exports[`should render optional fields correctly 1`] = `
485 <div>
486   <header
487     className="page-header"
488   >
489     <h1
490       className="page-title"
491     >
492       settings.pr_decoration.binding.title
493     </h1>
494   </header>
495   <div
496     className="markdown small spacer-top big-spacer-bottom"
497   >
498     settings.pr_decoration.binding.description
499   </div>
500   <form
501     onSubmit={[Function]}
502   >
503     <div
504       className="form-field"
505     >
506       <label
507         htmlFor="name"
508       >
509         settings.pr_decoration.binding.form.name
510         <em
511           className="mandatory spacer-right"
512         >
513           *
514         </em>
515       </label>
516       <Select
517         autosize={true}
518         className="abs-width-400"
519         clearable={false}
520         id="name"
521         menuContainerStyle={
522           Object {
523             "maxWidth": "210%",
524             "width": "auto",
525           }
526         }
527         onChange={[Function]}
528         optionRenderer={[Function]}
529         options={
530           Array [
531             Object {
532               "alm": "gitlab",
533               "key": "key",
534               "url": "http://example.com",
535             },
536           ]
537         }
538         searchable={false}
539         value="key"
540         valueKey="key"
541         valueRenderer={[Function]}
542       />
543     </div>
544     <div
545       className="form-field"
546     >
547       <label
548         className="display-flex-center"
549         htmlFor="gitlab.repository"
550       >
551         settings.pr_decoration.binding.form.gitlab.repository
552         <HelpTooltip
553           className="spacer-left"
554           overlay={
555             <FormattedMessage
556               defaultMessage="settings.pr_decoration.binding.form.gitlab.repository.help"
557               id="settings.pr_decoration.binding.form.gitlab.repository.help"
558               values={Object {}}
559             />
560           }
561           placement="right"
562         />
563       </label>
564       <input
565         className="input-super-large"
566         id="gitlab.repository"
567         maxLength={256}
568         name="gitlab.repository"
569         onChange={[Function]}
570         type="text"
571         value=""
572       />
573     </div>
574     <div
575       className="display-flex-center"
576     >
577       <DeferredSpinner
578         className="spacer-right"
579         loading={false}
580         timeout={100}
581       />
582       <SubmitButton
583         className="spacer-right button-success"
584         disabled={true}
585       >
586         <span
587           data-test="project-settings__alm-save"
588         >
589           save
590         </span>
591       </SubmitButton>
592     </div>
593   </form>
594 </div>
595 `;
596
597 exports[`should render select options correctly 1`] = `
598 <span>
599   azure
600 </span>
601 `;
602
603 exports[`should render select options correctly 2`] = `
604 <React.Fragment>
605   <span>
606     github
607      — 
608   </span>
609   <span
610     className="text-muted"
611   >
612     gh.url.com
613   </span>
614 </React.Fragment>
615 `;
616
617 exports[`should render single instance correctly 1`] = `
618 <div>
619   <header
620     className="page-header"
621   >
622     <h1
623       className="page-title"
624     >
625       settings.pr_decoration.binding.title
626     </h1>
627   </header>
628   <div
629     className="markdown small spacer-top big-spacer-bottom"
630   >
631     settings.pr_decoration.binding.description
632   </div>
633   <form
634     onSubmit={[Function]}
635   >
636     <div
637       className="form-field"
638     >
639       <label
640         htmlFor="name"
641       >
642         settings.pr_decoration.binding.form.name
643         <em
644           className="mandatory spacer-right"
645         >
646           *
647         </em>
648       </label>
649       <Select
650         autosize={true}
651         className="abs-width-400"
652         clearable={false}
653         id="name"
654         menuContainerStyle={
655           Object {
656             "maxWidth": "210%",
657             "width": "auto",
658           }
659         }
660         onChange={[Function]}
661         optionRenderer={[Function]}
662         options={
663           Array [
664             Object {
665               "alm": "github",
666               "key": "single",
667               "url": "http://single.url",
668             },
669           ]
670         }
671         searchable={false}
672         value=""
673         valueKey="key"
674         valueRenderer={[Function]}
675       />
676     </div>
677     <div
678       className="display-flex-center"
679     >
680       <DeferredSpinner
681         className="spacer-right"
682         loading={false}
683         timeout={100}
684       />
685     </div>
686   </form>
687 </div>
688 `;