]> source.dussan.org Git - sonarqube.git/blob
4a1dbfb63b8f21cfd2822c072db3c4e452b0869b
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should display action section correctly when: configuration check is in progress 1`] = `
4 <div
5   className="display-flex-center big-spacer-top action-section"
6 >
7   <Button
8     className="spacer-right"
9     onClick={[MockFunction]}
10   >
11     <span
12       data-test="project-settings__alm-reset"
13     >
14       reset_verb
15     </span>
16   </Button>
17   <Button
18     disabled={true}
19     onClick={[MockFunction]}
20   >
21     settings.pr_decoration.binding.check_configuration
22     <DeferredSpinner
23       className="spacer-left"
24       loading={true}
25     />
26   </Button>
27 </div>
28 `;
29
30 exports[`should display action section correctly when: configuration is saved 1`] = `
31 <div
32   className="display-flex-center big-spacer-top action-section"
33 >
34   <Button
35     className="spacer-right"
36     onClick={[MockFunction]}
37   >
38     <span
39       data-test="project-settings__alm-reset"
40     >
41       reset_verb
42     </span>
43   </Button>
44   <Button
45     disabled={false}
46     onClick={[MockFunction]}
47   >
48     settings.pr_decoration.binding.check_configuration
49     <DeferredSpinner
50       className="spacer-left"
51       loading={false}
52     />
53   </Button>
54 </div>
55 `;
56
57 exports[`should display action section correctly when: form is valid 1`] = `
58 <div
59   className="display-flex-center big-spacer-top action-section"
60 />
61 `;
62
63 exports[`should display action section correctly when: update is successfull 1`] = `
64 <div
65   className="display-flex-center big-spacer-top action-section"
66 >
67   <span
68     className="text-success spacer-right"
69   >
70     <AlertSuccessIcon
71       className="spacer-right"
72     />
73     settings.state.saved
74   </span>
75 </div>
76 `;
77
78 exports[`should display action section correctly when: updating 1`] = `
79 <div
80   className="display-flex-center big-spacer-top action-section"
81 />
82 `;
83
84 exports[`should render correctly: when loading 1`] = `<DeferredSpinner />`;
85
86 exports[`should render correctly: when there are configuration errors (admin user) 1`] = `
87 <div>
88   <header
89     className="page-header"
90   >
91     <h1
92       className="page-title"
93     >
94       settings.pr_decoration.binding.title
95     </h1>
96   </header>
97   <div
98     className="markdown small spacer-top big-spacer-bottom"
99   >
100     settings.pr_decoration.binding.description
101   </div>
102   <form
103     onSubmit={[Function]}
104   >
105     <MandatoryFieldsExplanation
106       className="form-field"
107     />
108     <div
109       className="settings-definition big-spacer-bottom"
110     >
111       <div
112         className="settings-definition-left"
113       >
114         <label
115           className="h3"
116           htmlFor="name"
117         >
118           settings.pr_decoration.binding.form.name
119           <MandatoryFieldMarker
120             className="spacer-right"
121           />
122         </label>
123         <div
124           className="markdown small spacer-top"
125         >
126           settings.pr_decoration.binding.form.name.help
127         </div>
128       </div>
129       <div
130         className="settings-definition-right"
131       >
132         <Select
133           className="abs-width-400 big-spacer-top it__configuration-name-select"
134           components={
135             Object {
136               "Option": [Function],
137               "SingleValue": [Function],
138             }
139           }
140           inputId="name"
141           isClearable={false}
142           isSearchable={false}
143           onChange={[Function]}
144           options={
145             Array [
146               Object {
147                 "alm": "github",
148                 "key": "i1",
149                 "url": "http://github.enterprise.com",
150               },
151               Object {
152                 "alm": "github",
153                 "key": "i2",
154                 "url": "http://github.enterprise.com",
155               },
156               Object {
157                 "alm": "bitbucket",
158                 "key": "i3",
159                 "url": "http://bbs.enterprise.com",
160               },
161               Object {
162                 "alm": "azure",
163                 "key": "i4",
164               },
165             ]
166           }
167           value={
168             Array [
169               Object {
170                 "alm": "github",
171                 "key": "i1",
172                 "url": "http://github.enterprise.com",
173               },
174             ]
175           }
176         />
177       </div>
178     </div>
179     <withAvailableFeaturesContext(AlmSpecificForm)
180       alm="github"
181       formData={
182         Object {
183           "key": "i1",
184           "monorepo": false,
185           "repository": "account/repo",
186         }
187       }
188       instances={
189         Array [
190           Object {
191             "alm": "github",
192             "key": "i1",
193             "url": "http://github.enterprise.com",
194           },
195           Object {
196             "alm": "github",
197             "key": "i2",
198             "url": "http://github.enterprise.com",
199           },
200           Object {
201             "alm": "bitbucket",
202             "key": "i3",
203             "url": "http://bbs.enterprise.com",
204           },
205           Object {
206             "alm": "azure",
207             "key": "i4",
208           },
209         ]
210       }
211       onFieldChange={[MockFunction]}
212     />
213     <div
214       className="display-flex-center big-spacer-top action-section"
215     >
216       <Button
217         className="spacer-right"
218         onClick={[MockFunction]}
219       >
220         <span
221           data-test="project-settings__alm-reset"
222         >
223           reset_verb
224         </span>
225       </Button>
226       <Button
227         disabled={false}
228         onClick={[MockFunction]}
229       >
230         settings.pr_decoration.binding.check_configuration
231         <DeferredSpinner
232           className="spacer-left"
233           loading={false}
234         />
235       </Button>
236     </div>
237     <Alert
238       className="big-spacer-top"
239       display="inline"
240       variant="error"
241     >
242       <p
243         className="spacer-bottom"
244       >
245         settings.pr_decoration.binding.check_configuration.failure
246       </p>
247       <ul
248         className="list-styled"
249       >
250         <li
251           key="0"
252         >
253           Test
254         </li>
255         <li
256           key="1"
257         >
258           tesT
259         </li>
260       </ul>
261       <p>
262         <FormattedMessage
263           defaultMessage="settings.pr_decoration.binding.check_configuration.failure.check_global_settings"
264           id="settings.pr_decoration.binding.check_configuration.failure.check_global_settings"
265           values={
266             Object {
267               "link": <Link
268                 to={
269                   Object {
270                     "pathname": "/admin/settings",
271                     "search": "?category=almintegration&alm=github",
272                   }
273                 }
274               >
275                 settings.pr_decoration.binding.check_configuration.failure.check_global_settings.link
276               </Link>,
277             }
278           }
279         />
280       </p>
281     </Alert>
282   </form>
283 </div>
284 `;
285
286 exports[`should render correctly: when there are configuration errors (admin user) and error are at PROJECT level 1`] = `
287 <div>
288   <header
289     className="page-header"
290   >
291     <h1
292       className="page-title"
293     >
294       settings.pr_decoration.binding.title
295     </h1>
296   </header>
297   <div
298     className="markdown small spacer-top big-spacer-bottom"
299   >
300     settings.pr_decoration.binding.description
301   </div>
302   <form
303     onSubmit={[Function]}
304   >
305     <MandatoryFieldsExplanation
306       className="form-field"
307     />
308     <div
309       className="settings-definition big-spacer-bottom"
310     >
311       <div
312         className="settings-definition-left"
313       >
314         <label
315           className="h3"
316           htmlFor="name"
317         >
318           settings.pr_decoration.binding.form.name
319           <MandatoryFieldMarker
320             className="spacer-right"
321           />
322         </label>
323         <div
324           className="markdown small spacer-top"
325         >
326           settings.pr_decoration.binding.form.name.help
327         </div>
328       </div>
329       <div
330         className="settings-definition-right"
331       >
332         <Select
333           className="abs-width-400 big-spacer-top it__configuration-name-select"
334           components={
335             Object {
336               "Option": [Function],
337               "SingleValue": [Function],
338             }
339           }
340           inputId="name"
341           isClearable={false}
342           isSearchable={false}
343           onChange={[Function]}
344           options={
345             Array [
346               Object {
347                 "alm": "github",
348                 "key": "i1",
349                 "url": "http://github.enterprise.com",
350               },
351               Object {
352                 "alm": "github",
353                 "key": "i2",
354                 "url": "http://github.enterprise.com",
355               },
356               Object {
357                 "alm": "bitbucket",
358                 "key": "i3",
359                 "url": "http://bbs.enterprise.com",
360               },
361               Object {
362                 "alm": "azure",
363                 "key": "i4",
364               },
365             ]
366           }
367           value={Array []}
368         />
369       </div>
370     </div>
371     <div
372       className="display-flex-center big-spacer-top action-section"
373     >
374       <Button
375         className="spacer-right"
376         onClick={[MockFunction]}
377       >
378         <span
379           data-test="project-settings__alm-reset"
380         >
381           reset_verb
382         </span>
383       </Button>
384       <Button
385         disabled={false}
386         onClick={[MockFunction]}
387       >
388         settings.pr_decoration.binding.check_configuration
389         <DeferredSpinner
390           className="spacer-left"
391           loading={false}
392         />
393       </Button>
394     </div>
395     <Alert
396       className="big-spacer-top"
397       display="inline"
398       variant="error"
399     >
400       <p
401         className="spacer-bottom"
402       >
403         settings.pr_decoration.binding.check_configuration.failure
404       </p>
405       <ul
406         className="list-styled"
407       >
408         <li
409           key="0"
410         >
411           Test
412         </li>
413         <li
414           key="1"
415         >
416           tesT
417         </li>
418       </ul>
419     </Alert>
420   </form>
421 </div>
422 `;
423
424 exports[`should render correctly: when there are configuration errors (non-admin user) 1`] = `
425 <div>
426   <header
427     className="page-header"
428   >
429     <h1
430       className="page-title"
431     >
432       settings.pr_decoration.binding.title
433     </h1>
434   </header>
435   <div
436     className="markdown small spacer-top big-spacer-bottom"
437   >
438     settings.pr_decoration.binding.description
439   </div>
440   <form
441     onSubmit={[Function]}
442   >
443     <MandatoryFieldsExplanation
444       className="form-field"
445     />
446     <div
447       className="settings-definition big-spacer-bottom"
448     >
449       <div
450         className="settings-definition-left"
451       >
452         <label
453           className="h3"
454           htmlFor="name"
455         >
456           settings.pr_decoration.binding.form.name
457           <MandatoryFieldMarker
458             className="spacer-right"
459           />
460         </label>
461         <div
462           className="markdown small spacer-top"
463         >
464           settings.pr_decoration.binding.form.name.help
465         </div>
466       </div>
467       <div
468         className="settings-definition-right"
469       >
470         <Select
471           className="abs-width-400 big-spacer-top it__configuration-name-select"
472           components={
473             Object {
474               "Option": [Function],
475               "SingleValue": [Function],
476             }
477           }
478           inputId="name"
479           isClearable={false}
480           isSearchable={false}
481           onChange={[Function]}
482           options={
483             Array [
484               Object {
485                 "alm": "github",
486                 "key": "i1",
487                 "url": "http://github.enterprise.com",
488               },
489               Object {
490                 "alm": "github",
491                 "key": "i2",
492                 "url": "http://github.enterprise.com",
493               },
494               Object {
495                 "alm": "bitbucket",
496                 "key": "i3",
497                 "url": "http://bbs.enterprise.com",
498               },
499               Object {
500                 "alm": "azure",
501                 "key": "i4",
502               },
503             ]
504           }
505           value={Array []}
506         />
507       </div>
508     </div>
509     <div
510       className="display-flex-center big-spacer-top action-section"
511     >
512       <Button
513         className="spacer-right"
514         onClick={[MockFunction]}
515       >
516         <span
517           data-test="project-settings__alm-reset"
518         >
519           reset_verb
520         </span>
521       </Button>
522       <Button
523         disabled={false}
524         onClick={[MockFunction]}
525       >
526         settings.pr_decoration.binding.check_configuration
527         <DeferredSpinner
528           className="spacer-left"
529           loading={false}
530         />
531       </Button>
532     </div>
533     <Alert
534       className="big-spacer-top"
535       display="inline"
536       variant="error"
537     >
538       <p
539         className="spacer-bottom"
540       >
541         settings.pr_decoration.binding.check_configuration.failure
542       </p>
543       <ul
544         className="list-styled"
545       >
546         <li
547           key="0"
548         >
549           Test
550         </li>
551         <li
552           key="1"
553         >
554           tesT
555         </li>
556       </ul>
557       <p>
558         settings.pr_decoration.binding.check_configuration.contact_admin
559       </p>
560     </Alert>
561   </form>
562 </div>
563 `;
564
565 exports[`should render correctly: with a single ALM instance 1`] = `
566 <div>
567   <header
568     className="page-header"
569   >
570     <h1
571       className="page-title"
572     >
573       settings.pr_decoration.binding.title
574     </h1>
575   </header>
576   <div
577     className="markdown small spacer-top big-spacer-bottom"
578   >
579     settings.pr_decoration.binding.description
580   </div>
581   <form
582     onSubmit={[Function]}
583   >
584     <MandatoryFieldsExplanation
585       className="form-field"
586     />
587     <div
588       className="settings-definition big-spacer-bottom"
589     >
590       <div
591         className="settings-definition-left"
592       >
593         <label
594           className="h3"
595           htmlFor="name"
596         >
597           settings.pr_decoration.binding.form.name
598           <MandatoryFieldMarker
599             className="spacer-right"
600           />
601         </label>
602         <div
603           className="markdown small spacer-top"
604         >
605           settings.pr_decoration.binding.form.name.help
606         </div>
607       </div>
608       <div
609         className="settings-definition-right"
610       >
611         <Select
612           className="abs-width-400 big-spacer-top it__configuration-name-select"
613           components={
614             Object {
615               "Option": [Function],
616               "SingleValue": [Function],
617             }
618           }
619           inputId="name"
620           isClearable={false}
621           isSearchable={false}
622           onChange={[Function]}
623           options={
624             Array [
625               Object {
626                 "alm": "github",
627                 "key": "i1",
628                 "url": "http://github.enterprise.com",
629               },
630             ]
631           }
632           value={Array []}
633         />
634       </div>
635     </div>
636     <div
637       className="display-flex-center big-spacer-top action-section"
638     />
639   </form>
640 </div>
641 `;
642
643 exports[`should render correctly: with a valid and saved form 1`] = `
644 <div>
645   <header
646     className="page-header"
647   >
648     <h1
649       className="page-title"
650     >
651       settings.pr_decoration.binding.title
652     </h1>
653   </header>
654   <div
655     className="markdown small spacer-top big-spacer-bottom"
656   >
657     settings.pr_decoration.binding.description
658   </div>
659   <form
660     onSubmit={[Function]}
661   >
662     <MandatoryFieldsExplanation
663       className="form-field"
664     />
665     <div
666       className="settings-definition big-spacer-bottom"
667     >
668       <div
669         className="settings-definition-left"
670       >
671         <label
672           className="h3"
673           htmlFor="name"
674         >
675           settings.pr_decoration.binding.form.name
676           <MandatoryFieldMarker
677             className="spacer-right"
678           />
679         </label>
680         <div
681           className="markdown small spacer-top"
682         >
683           settings.pr_decoration.binding.form.name.help
684         </div>
685       </div>
686       <div
687         className="settings-definition-right"
688       >
689         <Select
690           className="abs-width-400 big-spacer-top it__configuration-name-select"
691           components={
692             Object {
693               "Option": [Function],
694               "SingleValue": [Function],
695             }
696           }
697           inputId="name"
698           isClearable={false}
699           isSearchable={false}
700           onChange={[Function]}
701           options={
702             Array [
703               Object {
704                 "alm": "github",
705                 "key": "i1",
706                 "url": "http://github.enterprise.com",
707               },
708               Object {
709                 "alm": "github",
710                 "key": "i2",
711                 "url": "http://github.enterprise.com",
712               },
713               Object {
714                 "alm": "bitbucket",
715                 "key": "i3",
716                 "url": "http://bbs.enterprise.com",
717               },
718               Object {
719                 "alm": "azure",
720                 "key": "i4",
721               },
722             ]
723           }
724           value={
725             Array [
726               Object {
727                 "alm": "github",
728                 "key": "i1",
729                 "url": "http://github.enterprise.com",
730               },
731             ]
732           }
733         />
734       </div>
735     </div>
736     <withAvailableFeaturesContext(AlmSpecificForm)
737       alm="github"
738       formData={
739         Object {
740           "key": "i1",
741           "monorepo": false,
742           "repository": "account/repo",
743         }
744       }
745       instances={
746         Array [
747           Object {
748             "alm": "github",
749             "key": "i1",
750             "url": "http://github.enterprise.com",
751           },
752           Object {
753             "alm": "github",
754             "key": "i2",
755             "url": "http://github.enterprise.com",
756           },
757           Object {
758             "alm": "bitbucket",
759             "key": "i3",
760             "url": "http://bbs.enterprise.com",
761           },
762           Object {
763             "alm": "azure",
764             "key": "i4",
765           },
766         ]
767       }
768       onFieldChange={[MockFunction]}
769     />
770     <div
771       className="display-flex-center big-spacer-top action-section"
772     >
773       <Button
774         className="spacer-right"
775         onClick={[MockFunction]}
776       >
777         <span
778           data-test="project-settings__alm-reset"
779         >
780           reset_verb
781         </span>
782       </Button>
783       <Button
784         disabled={false}
785         onClick={[MockFunction]}
786       >
787         settings.pr_decoration.binding.check_configuration
788         <DeferredSpinner
789           className="spacer-left"
790           loading={false}
791         />
792       </Button>
793     </div>
794     <Alert
795       className="big-spacer-top"
796       display="inline"
797       variant="success"
798     >
799       settings.pr_decoration.binding.check_configuration.success
800     </Alert>
801   </form>
802 </div>
803 `;
804
805 exports[`should render correctly: with an empty form 1`] = `
806 <div>
807   <header
808     className="page-header"
809   >
810     <h1
811       className="page-title"
812     >
813       settings.pr_decoration.binding.title
814     </h1>
815   </header>
816   <div
817     className="markdown small spacer-top big-spacer-bottom"
818   >
819     settings.pr_decoration.binding.description
820   </div>
821   <form
822     onSubmit={[Function]}
823   >
824     <MandatoryFieldsExplanation
825       className="form-field"
826     />
827     <div
828       className="settings-definition big-spacer-bottom"
829     >
830       <div
831         className="settings-definition-left"
832       >
833         <label
834           className="h3"
835           htmlFor="name"
836         >
837           settings.pr_decoration.binding.form.name
838           <MandatoryFieldMarker
839             className="spacer-right"
840           />
841         </label>
842         <div
843           className="markdown small spacer-top"
844         >
845           settings.pr_decoration.binding.form.name.help
846         </div>
847       </div>
848       <div
849         className="settings-definition-right"
850       >
851         <Select
852           className="abs-width-400 big-spacer-top it__configuration-name-select"
853           components={
854             Object {
855               "Option": [Function],
856               "SingleValue": [Function],
857             }
858           }
859           inputId="name"
860           isClearable={false}
861           isSearchable={false}
862           onChange={[Function]}
863           options={
864             Array [
865               Object {
866                 "alm": "github",
867                 "key": "i1",
868                 "url": "http://github.enterprise.com",
869               },
870               Object {
871                 "alm": "github",
872                 "key": "i2",
873                 "url": "http://github.enterprise.com",
874               },
875               Object {
876                 "alm": "bitbucket",
877                 "key": "i3",
878                 "url": "http://bbs.enterprise.com",
879               },
880               Object {
881                 "alm": "azure",
882                 "key": "i4",
883               },
884             ]
885           }
886           value={Array []}
887         />
888       </div>
889     </div>
890     <div
891       className="display-flex-center big-spacer-top action-section"
892     />
893   </form>
894 </div>
895 `;
896
897 exports[`should render correctly: with no ALM instances (admin user) 1`] = `
898 <div>
899   <Alert
900     className="spacer-top huge-spacer-bottom"
901     variant="info"
902   >
903     <FormattedMessage
904       defaultMessage="settings.pr_decoration.binding.no_bindings.admin"
905       id="settings.pr_decoration.binding.no_bindings.admin"
906       values={
907         Object {
908           "link": <Link
909             to={
910               Object {
911                 "pathname": "/admin/settings",
912                 "search": "?category=almintegration",
913               }
914             }
915           >
916             settings.pr_decoration.binding.no_bindings.link
917           </Link>,
918         }
919       }
920     />
921   </Alert>
922 </div>
923 `;
924
925 exports[`should render correctly: with no ALM instances (non-admin user) 1`] = `
926 <div>
927   <Alert
928     className="spacer-top huge-spacer-bottom"
929     variant="info"
930   >
931     settings.pr_decoration.binding.no_bindings
932   </Alert>
933 </div>
934 `;