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