]> source.dussan.org Git - sonarqube.git/blob
7d0ea3c9c88d6457eea34e93ee19b38f95466e44
[sonarqube.git] /
1 // Jest Snapshot v1, https://goo.gl/fbAQLP
2
3 exports[`renderActions should disable the button when I am on a built-in profile: activate 1`] = `
4 <td
5   className="coding-rule-table-meta-cell coding-rule-activation-actions"
6 >
7   <Tooltip
8     overlay="coding_rules.need_extend_or_copy"
9   >
10     <Button
11       className="coding-rules-detail-quality-profile-deactivate button-red disabled"
12     >
13       coding_rules.activate
14     </Button>
15   </Tooltip>
16 </td>
17 `;
18
19 exports[`renderActions should disable the button when I am on a built-in profile: deactivate 1`] = `
20 <td
21   className="coding-rule-table-meta-cell coding-rule-activation-actions"
22 >
23   <Tooltip
24     overlay="coding_rules.need_extend_or_copy"
25   >
26     <Button
27       className="coding-rules-detail-quality-profile-deactivate button-red disabled"
28     >
29       coding_rules.deactivate
30     </Button>
31   </Tooltip>
32 </td>
33 `;
34
35 exports[`renderActions should render the activate button 1`] = `
36 <td
37   className="coding-rule-table-meta-cell coding-rule-activation-actions"
38 >
39   <ActivationButton
40     buttonText="coding_rules.activate"
41     className="coding-rules-detail-quality-profile-activate"
42     modalHeader="coding_rules.activate_in_quality_profile"
43     onDone={[Function]}
44     profiles={
45       [
46         {
47           "actions": {
48             "edit": true,
49           },
50           "activeDeprecatedRuleCount": 2,
51           "activeRuleCount": 10,
52           "childrenCount": 0,
53           "depth": 1,
54           "isBuiltIn": false,
55           "isDefault": false,
56           "isInherited": false,
57           "key": "key",
58           "language": "js",
59           "languageName": "JavaScript",
60           "name": "name",
61           "projectCount": 3,
62         },
63       ]
64     }
65     rule={
66       {
67         "isTemplate": false,
68         "key": "javascript:S1067",
69         "lang": "js",
70         "langName": "JavaScript",
71         "name": "Use foo",
72         "severity": "MAJOR",
73         "status": "READY",
74         "sysTags": [
75           "a",
76           "b",
77         ],
78         "tags": [
79           "x",
80         ],
81         "type": "CODE_SMELL",
82       }
83     }
84   />
85 </td>
86 `;
87
88 exports[`renderActions should render the deactivate button 1`] = `
89 <td
90   className="coding-rule-table-meta-cell coding-rule-activation-actions"
91 >
92   <ConfirmButton
93     confirmButtonText="yes"
94     modalBody="coding_rules.deactivate.confirm"
95     modalHeader="coding_rules.deactivate"
96     onConfirm={[Function]}
97   >
98     [Function]
99   </ConfirmButton>
100 </td>
101 `;
102
103 exports[`should render correctly: default 1`] = `
104 <div
105   aria-selected={false}
106   className="coding-rule"
107   data-rule="javascript:S1067"
108   role="row"
109 >
110   <table
111     className="coding-rule-table"
112   >
113     <tbody>
114       <tr>
115         <td>
116           <div
117             className="coding-rule-title"
118           >
119             <ForwardRef(Link)
120               className="link-no-underline"
121               onClick={[Function]}
122               to={
123                 {
124                   "pathname": "/coding_rules",
125                   "search": "?open=javascript%3AS1067&rule_key=javascript%3AS1067",
126                 }
127               }
128             >
129               Use foo
130             </ForwardRef(Link)>
131           </div>
132         </td>
133         <td
134           className="coding-rule-table-meta-cell"
135         >
136           <div
137             className="display-flex-center coding-rule-meta"
138           >
139             <span
140               className="display-inline-flex-center spacer-left note"
141             >
142               JavaScript
143             </span>
144             <Tooltip
145               overlay="coding_rules.type.tooltip.CODE_SMELL"
146             >
147               <span
148                 className="display-inline-flex-center spacer-left note"
149               >
150                 <IssueTypeIcon
151                   query="CODE_SMELL"
152                 />
153                 <span
154                   className="little-spacer-left text-middle"
155                 >
156                   issue.type.CODE_SMELL
157                 </span>
158               </span>
159             </Tooltip>
160             <TagsList
161               allowUpdate={false}
162               className="display-inline-flex-center note spacer-left"
163               tags={
164                 [
165                   "x",
166                   "a",
167                   "b",
168                 ]
169               }
170             />
171             <SimilarRulesFilter
172               onFilterChange={[MockFunction]}
173               rule={
174                 {
175                   "key": "javascript:S1067",
176                   "lang": "js",
177                   "langName": "JavaScript",
178                   "name": "Use foo",
179                   "severity": "MAJOR",
180                   "status": "READY",
181                   "sysTags": [
182                     "a",
183                     "b",
184                   ],
185                   "tags": [
186                     "x",
187                   ],
188                   "type": "CODE_SMELL",
189                 }
190               }
191             />
192           </div>
193         </td>
194       </tr>
195     </tbody>
196   </table>
197 </div>
198 `;
199
200 exports[`should render correctly: with activation 1`] = `
201 <div
202   aria-selected={false}
203   className="coding-rule"
204   data-rule="javascript:S1067"
205   role="row"
206 >
207   <table
208     className="coding-rule-table"
209   >
210     <tbody>
211       <tr>
212         <td>
213           <div
214             className="coding-rule-title"
215           >
216             <ForwardRef(Link)
217               className="link-no-underline"
218               onClick={[Function]}
219               to={
220                 {
221                   "pathname": "/coding_rules",
222                   "search": "?open=javascript%3AS1067&rule_key=javascript%3AS1067",
223                 }
224               }
225             >
226               Use foo
227             </ForwardRef(Link)>
228           </div>
229         </td>
230         <td
231           className="coding-rule-table-meta-cell"
232         >
233           <div
234             className="display-flex-center coding-rule-meta"
235           >
236             <span
237               className="display-inline-flex-center spacer-left note"
238             >
239               JavaScript
240             </span>
241             <Tooltip
242               overlay="coding_rules.type.tooltip.CODE_SMELL"
243             >
244               <span
245                 className="display-inline-flex-center spacer-left note"
246               >
247                 <IssueTypeIcon
248                   query="CODE_SMELL"
249                 />
250                 <span
251                   className="little-spacer-left text-middle"
252                 >
253                   issue.type.CODE_SMELL
254                 </span>
255               </span>
256             </Tooltip>
257             <TagsList
258               allowUpdate={false}
259               className="display-inline-flex-center note spacer-left"
260               tags={
261                 [
262                   "x",
263                   "a",
264                   "b",
265                 ]
266               }
267             />
268             <SimilarRulesFilter
269               onFilterChange={[MockFunction]}
270               rule={
271                 {
272                   "key": "javascript:S1067",
273                   "lang": "js",
274                   "langName": "JavaScript",
275                   "name": "Use foo",
276                   "severity": "MAJOR",
277                   "status": "READY",
278                   "sysTags": [
279                     "a",
280                     "b",
281                   ],
282                   "tags": [
283                     "x",
284                   ],
285                   "type": "CODE_SMELL",
286                 }
287               }
288             />
289           </div>
290         </td>
291       </tr>
292     </tbody>
293   </table>
294 </div>
295 `;