]> source.dussan.org Git - sonarqube.git/blob
a87d5985b3f08aa080a8db3310189f50bc4fb938
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`should correctly handle the submit event and close the modal 1`] = `
4 Array [
5   Array [
6     Object {
7       "avatar": "",
8       "groupCount": 3,
9       "login": "admin",
10       "name": "Admin Istrator",
11     },
12     Array [
13       "7",
14     ],
15     Array [
16       "11",
17     ],
18   ],
19 ]
20 `;
21
22 exports[`should correctly handle the submit event and close the modal 2`] = `
23 Object {
24   "loading": false,
25   "open": false,
26   "userGroups": Object {
27     "11": Object {
28       "description": "Technical accounts",
29       "id": 11,
30       "name": "pull-request-analysers",
31       "selected": true,
32       "status": "remove",
33     },
34     "7": Object {
35       "status": "add",
36     },
37   },
38 }
39 `;
40
41 exports[`should correctly handle user interactions 1`] = `
42 Object {
43   "loading": false,
44   "open": true,
45   "userGroups": Object {
46     "11": Object {
47       "description": "Technical accounts",
48       "id": 11,
49       "name": "pull-request-analysers",
50       "selected": true,
51     },
52   },
53 }
54 `;
55
56 exports[`should correctly select the groups 1`] = `
57 Object {
58   "11": Object {
59     "description": "Technical accounts",
60     "id": 11,
61     "name": "pull-request-analysers",
62     "selected": true,
63     "status": "remove",
64   },
65   "7": Object {
66     "status": "add",
67   },
68 }
69 `;
70
71 exports[`should render and open the modal 1`] = `
72 <a
73   href="#"
74   onClick={[Function]}
75 >
76   organization.members.manage_groups
77 </a>
78 `;
79
80 exports[`should render and open the modal 2`] = `
81 <a
82   href="#"
83   onClick={[Function]}
84 >
85   organization.members.manage_groups
86   <Modal
87     ariaHideApp={true}
88     className="modal"
89     closeTimeoutMS={0}
90     contentLabel="modal form"
91     isOpen={true}
92     onRequestClose={[Function]}
93     overlayClassName="modal-overlay"
94     parentSelector={[Function]}
95     portalClassName="ReactModalPortal"
96     shouldCloseOnOverlayClick={true}
97   >
98     <header
99       className="modal-head"
100     >
101       <h2>
102         organization.members.manage_groups
103       </h2>
104     </header>
105     <form
106       onSubmit={[Function]}
107     >
108       <div
109         className="modal-body"
110       >
111         <strong>
112           organization.members.members_groups.Admin Istrator
113         </strong>
114          
115         <ul
116           className="list-spaced"
117         >
118           <OrganizationGroupCheckbox
119             checked={false}
120             group={
121               Object {
122                 "description": "",
123                 "id": "7",
124                 "membersCount": 12,
125                 "name": "professionals",
126               }
127             }
128             onCheck={[Function]}
129           />
130           <OrganizationGroupCheckbox
131             checked={false}
132             group={
133               Object {
134                 "description": "Technical accounts",
135                 "id": "11",
136                 "membersCount": 3,
137                 "name": "pull-request-analysers",
138               }
139             }
140             onCheck={[Function]}
141           />
142           <OrganizationGroupCheckbox
143             checked={false}
144             group={
145               Object {
146                 "description": "System administrators",
147                 "id": "1",
148                 "membersCount": 17,
149                 "name": "sonar-administrators",
150               }
151             }
152             onCheck={[Function]}
153           />
154         </ul>
155       </div>
156       <footer
157         className="modal-foot"
158       >
159         <div>
160           <button
161             type="submit"
162           >
163             save
164           </button>
165           <button
166             className="button-link"
167             onClick={[Function]}
168             type="reset"
169           >
170             cancel
171           </button>
172         </div>
173       </footer>
174     </form>
175   </Modal>
176 </a>
177 `;
178
179 exports[`should reset the selected groups when the modal is opened 1`] = `
180 Object {
181   "loading": false,
182   "open": true,
183   "userGroups": Object {
184     "11": Object {
185       "description": "Technical accounts",
186       "id": 11,
187       "name": "pull-request-analysers",
188       "selected": true,
189       "status": "remove",
190     },
191     "7": Object {
192       "status": "add",
193     },
194   },
195 }
196 `;
197
198 exports[`should reset the selected groups when the modal is opened 2`] = `
199 Object {
200   "loading": false,
201   "open": true,
202   "userGroups": Object {
203     "11": Object {
204       "description": "Technical accounts",
205       "id": 11,
206       "name": "pull-request-analysers",
207       "selected": true,
208     },
209   },
210 }
211 `;