]> source.dussan.org Git - sonarqube.git/blob
9a9f3631fce4de375d936a0a65df39bdd1e060cf
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`renderBulkButton should be null when the user does not have the sufficient permission 1`] = `<div />`;
4
5 exports[`renderBulkButton should be null when the user is not logged in 1`] = `<div />`;
6
7 exports[`renderBulkButton should show bulk change button when user has edit rights on specific quality profile 1`] = `
8 <BulkChange
9   query={
10     {
11       "activation": undefined,
12       "activationSeverities": [],
13       "availableSince": undefined,
14       "compareToProfile": undefined,
15       "cwe": [],
16       "inheritance": undefined,
17       "languages": [],
18       "owaspTop10": [],
19       "owaspTop10-2021": [],
20       "profile": undefined,
21       "repositories": [],
22       "ruleKey": undefined,
23       "searchQuery": undefined,
24       "severities": [],
25       "sonarsourceSecurity": [],
26       "statuses": [],
27       "tags": [],
28       "template": undefined,
29       "types": [],
30     }
31   }
32   referencedProfiles={
33     {
34       "foo": {
35         "actions": {
36           "edit": true,
37         },
38         "activeDeprecatedRuleCount": 2,
39         "activeRuleCount": 10,
40         "childrenCount": 0,
41         "depth": 1,
42         "isBuiltIn": false,
43         "isDefault": false,
44         "isInherited": false,
45         "key": "foo",
46         "language": "js",
47         "languageName": "JavaScript",
48         "name": "name",
49         "projectCount": 3,
50       },
51       "key": {
52         "activeDeprecatedRuleCount": 2,
53         "activeRuleCount": 10,
54         "childrenCount": 0,
55         "depth": 1,
56         "isBuiltIn": false,
57         "isDefault": false,
58         "isInherited": false,
59         "key": "key",
60         "language": "js",
61         "languageName": "JavaScript",
62         "name": "name",
63         "projectCount": 3,
64       },
65     }
66   }
67   total={0}
68 />
69 `;
70
71 exports[`renderBulkButton should show bulk change button when user has global admin rights on quality profiles 1`] = `
72 <BulkChange
73   query={
74     {
75       "activation": undefined,
76       "activationSeverities": [],
77       "availableSince": undefined,
78       "compareToProfile": undefined,
79       "cwe": [],
80       "inheritance": undefined,
81       "languages": [],
82       "owaspTop10": [],
83       "owaspTop10-2021": [],
84       "profile": undefined,
85       "repositories": [],
86       "ruleKey": undefined,
87       "searchQuery": undefined,
88       "severities": [],
89       "sonarsourceSecurity": [],
90       "statuses": [],
91       "tags": [],
92       "template": undefined,
93       "types": [],
94     }
95   }
96   referencedProfiles={{}}
97   total={0}
98 />
99 `;
100
101 exports[`should render correctly: loaded (ScreenPositionHelper) 1`] = `
102 <nav
103   aria-label="filters"
104   className="layout-page-side"
105   style={
106     {
107       "top": 0,
108     }
109   }
110 >
111   <div
112     className="layout-page-side-inner"
113   >
114     <div
115       className="layout-page-filters"
116     >
117       <A11ySkipTarget
118         anchor="rules_filters"
119         label="coding_rules.skip_to_filters"
120         weight={10}
121       />
122       <FiltersHeader
123         displayReset={false}
124         onReset={[Function]}
125       />
126       <SearchBox
127         className="spacer-bottom"
128         id="coding-rules-search"
129         maxLength={200}
130         minLength={2}
131         onChange={[Function]}
132         placeholder="search.search_for_rules"
133         value=""
134       />
135       <FacetsList
136         facets={{}}
137         onFacetToggle={[Function]}
138         onFilterChange={[Function]}
139         openFacets={
140           {
141             "languages": true,
142             "owaspTop10": false,
143             "owaspTop10-2021": false,
144             "sonarsourceSecurity": false,
145             "standards": false,
146             "types": true,
147           }
148         }
149         query={
150           {
151             "activation": undefined,
152             "activationSeverities": [],
153             "availableSince": undefined,
154             "compareToProfile": undefined,
155             "cwe": [],
156             "inheritance": undefined,
157             "languages": [],
158             "owaspTop10": [],
159             "owaspTop10-2021": [],
160             "profile": undefined,
161             "repositories": [],
162             "ruleKey": undefined,
163             "searchQuery": undefined,
164             "severities": [],
165             "sonarsourceSecurity": [],
166             "statuses": [],
167             "tags": [],
168             "template": undefined,
169             "types": [],
170           }
171         }
172         referencedProfiles={{}}
173         referencedRepositories={{}}
174       />
175     </div>
176   </div>
177 </nav>
178 `;
179
180 exports[`should render correctly: loaded 1`] = `
181 <Fragment>
182   <Suggestions
183     suggestions="coding_rules"
184   />
185   <Helmet
186     defer={false}
187     encodeSpecialCharacters={true}
188     prioritizeSeoTags={false}
189     title="coding_rules.page"
190   >
191     <meta
192       content="noindex"
193       name="robots"
194     />
195   </Helmet>
196   <div
197     className="layout-page"
198     id="coding-rules-page"
199   >
200     <ScreenPositionHelper
201       className="layout-page-side-outer"
202     >
203       <Component />
204     </ScreenPositionHelper>
205     <main
206       className="layout-page-main"
207     >
208       <div
209         className="layout-page-header-panel layout-page-main-header"
210       >
211         <div
212           className="layout-page-header-panel-inner layout-page-main-header-inner"
213         >
214           <div
215             className="layout-page-main-inner"
216           >
217             <A11ySkipTarget
218               anchor="rules_main"
219             />
220             <div
221               className="display-flex-space-between"
222             >
223               <BulkChange
224                 query={
225                   {
226                     "activation": undefined,
227                     "activationSeverities": [],
228                     "availableSince": undefined,
229                     "compareToProfile": undefined,
230                     "cwe": [],
231                     "inheritance": undefined,
232                     "languages": [],
233                     "owaspTop10": [],
234                     "owaspTop10-2021": [],
235                     "profile": undefined,
236                     "repositories": [],
237                     "ruleKey": undefined,
238                     "searchQuery": undefined,
239                     "severities": [],
240                     "sonarsourceSecurity": [],
241                     "statuses": [],
242                     "tags": [],
243                     "template": undefined,
244                     "types": [],
245                   }
246                 }
247                 referencedProfiles={{}}
248                 total={0}
249               />
250               <PageActions
251                 paging={
252                   {
253                     "pageIndex": 0,
254                     "pageSize": 100,
255                     "total": 0,
256                   }
257                 }
258               />
259             </div>
260           </div>
261         </div>
262       </div>
263       <div
264         className="layout-page-main-inner"
265       >
266         <ul
267           aria-label="list_of_rules"
268         >
269           <RuleListItem
270             isLoggedIn={true}
271             key="javascript:S1067"
272             onActivate={[Function]}
273             onDeactivate={[Function]}
274             onFilterChange={[Function]}
275             onOpen={[Function]}
276             rule={
277               {
278                 "key": "javascript:S1067",
279                 "lang": "js",
280                 "langName": "JavaScript",
281                 "name": "Use foo",
282                 "severity": "MAJOR",
283                 "status": "READY",
284                 "sysTags": [
285                   "a",
286                   "b",
287                 ],
288                 "tags": [
289                   "x",
290                 ],
291                 "type": "CODE_SMELL",
292               }
293             }
294             selected={false}
295           />
296           <RuleListItem
297             isLoggedIn={true}
298             key="javascript:S1067"
299             onActivate={[Function]}
300             onDeactivate={[Function]}
301             onFilterChange={[Function]}
302             onOpen={[Function]}
303             rule={
304               {
305                 "key": "javascript:S1067",
306                 "lang": "js",
307                 "langName": "JavaScript",
308                 "name": "Use foo",
309                 "severity": "MAJOR",
310                 "status": "READY",
311                 "sysTags": [
312                   "a",
313                   "b",
314                 ],
315                 "tags": [
316                   "x",
317                 ],
318                 "type": "CODE_SMELL",
319               }
320             }
321             selected={false}
322           />
323         </ul>
324         <ListFooter
325           count={2}
326           loadMore={[Function]}
327           ready={true}
328           total={0}
329         />
330       </div>
331     </main>
332   </div>
333 </Fragment>
334 `;
335
336 exports[`should render correctly: loading 1`] = `
337 <Fragment>
338   <Suggestions
339     suggestions="coding_rules"
340   />
341   <Helmet
342     defer={false}
343     encodeSpecialCharacters={true}
344     prioritizeSeoTags={false}
345     title="coding_rules.page"
346   >
347     <meta
348       content="noindex"
349       name="robots"
350     />
351   </Helmet>
352   <div
353     className="layout-page"
354     id="coding-rules-page"
355   >
356     <ScreenPositionHelper
357       className="layout-page-side-outer"
358     >
359       <Component />
360     </ScreenPositionHelper>
361     <main
362       className="layout-page-main"
363     >
364       <div
365         className="layout-page-header-panel layout-page-main-header"
366       >
367         <div
368           className="layout-page-header-panel-inner layout-page-main-header-inner"
369         >
370           <div
371             className="layout-page-main-inner"
372           >
373             <A11ySkipTarget
374               anchor="rules_main"
375             />
376             <div
377               className="display-flex-space-between"
378             >
379               <div />
380               <PageActions />
381             </div>
382           </div>
383         </div>
384       </div>
385       <div
386         className="layout-page-main-inner"
387       >
388         <ul
389           aria-label="list_of_rules"
390         />
391       </div>
392     </main>
393   </div>
394 </Fragment>
395 `;