Skip to content

Commit 1a48783

Browse files
committed
fix: Fixed broken tests and linting errors.
1 parent 1af6a4b commit 1a48783

File tree

3 files changed

+215
-1
lines changed

3 files changed

+215
-1
lines changed

packages/module/patternfly-docs/content/extensions/component-groups/examples/Severity/Severity.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ To style no severity, pass "none" or `SeverityType.none` to `severity`.
4444

4545
```js file="./SeverityNoneExample.tsx"
4646

47+
```
48+
4749
### Minor severity
4850

4951
To style a minor severity, pass "minor" or `SeverityType.minor` to `severity`.

packages/module/src/Severity/Severity.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const Severity: React.FunctionComponent<SeverityProps> = ({
119119

120120
const title = { title: `${severity} ${label}` };
121121

122-
const batteryVariant = useMemo(() => batteryLevels(severity), [severity]);
122+
const batteryVariant = useMemo(() => batteryLevels(severity), [ severity ]);
123123

124124
return (
125125
<React.Fragment>
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Severity component API should hide label 1`] = `
4+
<div>
5+
<i
6+
class="battery-0-2-1 severityImportant-0-2-5"
7+
data-ouia-component-id="Severity-icon"
8+
title="important important"
9+
widget-id="important"
10+
widget-type="Severity"
11+
>
12+
<svg
13+
aria-hidden="true"
14+
class="pf-v6-svg"
15+
fill="currentColor"
16+
height="1em"
17+
role="img"
18+
viewBox="0 0 1024 1024"
19+
width="1em"
20+
>
21+
<path
22+
d="M0,587.2c0,23.2,10.8,40.4,30.7,51.6,20.8,11.7,42.1,12.5,63.1-.5l378.4-235.4c26.5-16.7,51.7-16.4,78.7.5,123.4,77.2,247.5,153.4,371,230.5,22.9,14.3,44.9,18.7,69.3,5.3,24.5-13.5,32.5-35,32.3-61.4-.4-49.4,0-41.9,0-91.3s-.3-99.9,0-149.8c.2-27.6-11.5-47.8-35.1-61.8C841.4,187.2,694.4,99.5,547.5,11.7c-24.5-14.6-48.1-14.4-72.4.2C327.3,100.3,179.4,188.5,31.7,276.8c-21.1,12.6-31.7,31.5-31.7,56.1v254.3ZM1023.8,857.8c0,1.9,0-.6.2-10.3,0-2.1,0-4.1-.2-6.1v-35.1c0-29.9,0,8.8,0,33.8-1.8-23.9-13.4-41.7-34.9-54.4-147-87.7-294-175.4-441-263.3-24.5-14.6-48.1-14.4-72.4.2-147.7,88.4-295.6,176.6-443.4,265-21.1,12.6-31.7,31.4-31.7,56.1v120.3c0,23.2,10.8,40.4,30.7,51.6,20.8,11.7,42.1,12.5,63.1-.5l378.4-235.4c26.5-16.7,51.7-16.4,78.7.5,123.4,77.2,247.5,153.4,371,230.5,22.9,14.3,44.9,18.7,69.3,5.3,24.5-13.5,32.5-35,32.3-61.4-.2-32.3-.2-64.6-.2-96.9h.2Z"
23+
/>
24+
</svg>
25+
</i>
26+
</div>
27+
`;
28+
29+
exports[`Severity component should render correctly CriticalSeverity 1`] = `
30+
<div>
31+
<i
32+
class="battery-0-2-1 severityCritical-0-2-6"
33+
data-ouia-component-id="Severity-icon"
34+
title="critical Critical"
35+
widget-id="Critical"
36+
widget-type="Severity"
37+
>
38+
<svg
39+
aria-hidden="true"
40+
class="pf-v6-svg"
41+
fill="currentColor"
42+
height="1em"
43+
role="img"
44+
viewBox="0 0 1024 1024"
45+
width="1em"
46+
>
47+
<path
48+
d="M0,963.4c0,23.2,10.8,40.4,30.7,51.6,20.8,11.7,42.1,12.5,63.1-.5l378.6-235.6c26.5-16.7,51.7-16.4,78.7.5,123.5,77.3,247.6,153.5,371.2,230.7,22.9,14.3,44.9,18.7,69.3,5.3,24.5-13.5,32.5-35,32.3-61.5-.4-49.4,0-41.9,0-91.4s-.3-476.6,0-526.5c.2-27.6-11.5-47.8-35.1-61.9C841.8,186.5,694.7,98.6,547.8,10.8c-24.5-14.6-48.1-14.4-72.4.2C327.5,99.4,179.5,187.8,31.7,276.2,10.6,288.8,0,307.7,0,332.3v631.1H0Z"
49+
/>
50+
</svg>
51+
</i>
52+
<span>
53+
54+
Critical
55+
56+
</span>
57+
</div>
58+
`;
59+
60+
exports[`Severity component should render correctly HighSeverity 1`] = `
61+
<div>
62+
<i
63+
class="battery-0-2-1 severityImportant-0-2-5"
64+
data-ouia-component-id="Severity-icon"
65+
title="important Important"
66+
widget-id="Important"
67+
widget-type="Severity"
68+
>
69+
<svg
70+
aria-hidden="true"
71+
class="pf-v6-svg"
72+
fill="currentColor"
73+
height="1em"
74+
role="img"
75+
viewBox="0 0 1024 1024"
76+
width="1em"
77+
>
78+
<path
79+
d="M0,587.2c0,23.2,10.8,40.4,30.7,51.6,20.8,11.7,42.1,12.5,63.1-.5l378.4-235.4c26.5-16.7,51.7-16.4,78.7.5,123.4,77.2,247.5,153.4,371,230.5,22.9,14.3,44.9,18.7,69.3,5.3,24.5-13.5,32.5-35,32.3-61.4-.4-49.4,0-41.9,0-91.3s-.3-99.9,0-149.8c.2-27.6-11.5-47.8-35.1-61.8C841.4,187.2,694.4,99.5,547.5,11.7c-24.5-14.6-48.1-14.4-72.4.2C327.3,100.3,179.4,188.5,31.7,276.8c-21.1,12.6-31.7,31.5-31.7,56.1v254.3ZM1023.8,857.8c0,1.9,0-.6.2-10.3,0-2.1,0-4.1-.2-6.1v-35.1c0-29.9,0,8.8,0,33.8-1.8-23.9-13.4-41.7-34.9-54.4-147-87.7-294-175.4-441-263.3-24.5-14.6-48.1-14.4-72.4.2-147.7,88.4-295.6,176.6-443.4,265-21.1,12.6-31.7,31.4-31.7,56.1v120.3c0,23.2,10.8,40.4,30.7,51.6,20.8,11.7,42.1,12.5,63.1-.5l378.4-235.4c26.5-16.7,51.7-16.4,78.7.5,123.4,77.2,247.5,153.4,371,230.5,22.9,14.3,44.9,18.7,69.3,5.3,24.5-13.5,32.5-35,32.3-61.4-.2-32.3-.2-64.6-.2-96.9h.2Z"
80+
/>
81+
</svg>
82+
</i>
83+
<span>
84+
85+
Important
86+
87+
</span>
88+
</div>
89+
`;
90+
91+
exports[`Severity component should render correctly LowSeverity 1`] = `
92+
<div>
93+
<i
94+
class="battery-0-2-1 severityMinor-0-2-3"
95+
data-ouia-component-id="Severity-icon"
96+
title="minor Minor"
97+
widget-id="Minor"
98+
widget-type="Severity"
99+
>
100+
<svg
101+
aria-hidden="true"
102+
class="pf-v6-svg"
103+
fill="currentColor"
104+
height="1em"
105+
role="img"
106+
viewBox="0 0 1024 1024"
107+
width="1em"
108+
>
109+
<path
110+
d="M1023.9,538.3c0-49.4-.3-41.9,0-91.3.2-26.4-7.8-48-32.3-61.4-24.4-13.4-46.5-9-69.3,5.3-123.5,77.1-247.6,153.3-371,230.5-27,16.9-52.3,17.2-78.7.5L94.3,386.5c-20.9-13-42.2-12.2-63.1-.5-19.9,11.1-30.7,28.4-30.7,51.6v254.3c0,24.6,10.6,43.5,31.7,56.1,147.8,88.4,295.6,176.5,443.4,265,24.4,14.6,48,14.8,72.4.2,146.9-87.9,293.9-175.6,441-263.3,23.6-14.1,35.3-34.2,35.1-61.8-.4-49.9,0-99.9,0-149.8h0ZM1024.4,177.2c0-9.7,0-12.2-.2-10.3,0-32.3,0-64.6.2-96.9.2-26.4-7.8-48-32.3-61.4-24.4-13.4-46.5-9-69.3,5.3-123.5,77.1-247.6,153.3-371,230.5-27,16.9-52.3,17.2-78.7.5L94.7,9.7c-20.9-13-42.2-12.2-63.1-.5C11.7,20.3.9,37.5.9,60.7v120.3c0,24.6,10.6,43.5,31.7,56.1,147.8,88.4,295.6,176.5,443.4,265,24.4,14.6,48,14.8,72.4.2,146.9-87.9,293.9-175.6,441-263.3,21.4-12.8,33.1-30.6,34.9-54.4,0,25.1,0,63.7,0,33.8v-35.1c0-2,.2-4,.2-6.1h-.2Z"
111+
/>
112+
</svg>
113+
</i>
114+
<span>
115+
116+
Minor
117+
118+
</span>
119+
</div>
120+
`;
121+
122+
exports[`Severity component should render correctly LowSeverity 2`] = `
123+
<div>
124+
<i
125+
class="battery-0-2-1 severityMinor-0-2-3"
126+
data-ouia-component-id="Severity-icon"
127+
title="none None"
128+
widget-id="None"
129+
widget-type="Severity"
130+
>
131+
<svg
132+
aria-hidden="true"
133+
class="pf-v6-svg"
134+
fill="currentColor"
135+
height="1em"
136+
role="img"
137+
viewBox="0 0 1024 1024"
138+
width="1em"
139+
>
140+
<path
141+
d="M64,128h896c35.3,0,64,28.7,64,64v64c0,35.3-28.7,64-64,64H64c-35.3,0-64-28.7-64-64v-64c0-35.3,28.7-64,64-64ZM64,448h896c35.3,0,64,28.7,64,64v256c0,35.3-28.7,64-64,64H64c-35.3,0-64-28.7-64-64v-256c0-35.3,28.7-64,64-64Z"
142+
/>
143+
</svg>
144+
</i>
145+
<span>
146+
147+
None
148+
149+
</span>
150+
</div>
151+
`;
152+
153+
exports[`Severity component should render correctly MediumSeverity 1`] = `
154+
<div>
155+
<i
156+
class="battery-0-2-1 severityModerate-0-2-4"
157+
data-ouia-component-id="Severity-icon"
158+
title="moderate Moderate"
159+
widget-id="Moderate"
160+
widget-type="Severity"
161+
>
162+
<svg
163+
aria-hidden="true"
164+
class="pf-v6-svg"
165+
fill="currentColor"
166+
height="1em"
167+
role="img"
168+
viewBox="0 0 1024 1024"
169+
width="1em"
170+
>
171+
<path
172+
d="M.8,403.4c.2,25.2,0,28.2-.1,39.9,0-10.5,0-23.3.1-39.9ZM1023.2,389.4c0,1.7,0,3.4,0,5.2v8.7-13.9h0ZM1023.5,475h0v-32.2c0,6.4.2,15.3.2,32.2h-.2ZM1023.9,577.1c0,31.9-31.9,62.8-63.9,62.8H63.9C31.9,639.9,0,609,0,577.1c.4-62,.1-168.9.2-182.1,1.2-24.9,12.9-43.4,35-56.5,147.1-87.4,265.8-153.3,412.7-240.8,13.6-6.8,27.2-11.4,40.8-13.8,15.3-2.8,31.1-2.8,46.4,0,13.6,2.5,27.2,7.1,40.8,13.8,147,87.5,265.7,153.4,412.7,240.8,22.5,13.2,34.3,32.4,35,57.7,0,4.4-.2,131.6.2,180.8h0ZM.5,475c0-16.4,0-25.3.1-31.7v31.7h-.1ZM.7,394.6c0-1.8,0-3.5.1-5.2v13.8-8.6h-.1ZM1023.3,442.7c0-11.2-.3-14.6,0-39.3,0,16.3,0,29,0,39.3ZM63.9,752.1h896.1c35.3,0,64,28.3,64,63.3v63.3c0,34.9-28.6,63.3-64,63.3H63.9c-35.3.1-63.9-28.2-63.9-63.2v-63.3c0-34.9,28.6-63.3,64-63.3h0Z"
173+
/>
174+
</svg>
175+
</i>
176+
<span>
177+
178+
Moderate
179+
180+
</span>
181+
</div>
182+
`;
183+
184+
exports[`Severity component should render correctly UndefinedSeverity, default 1`] = `
185+
<div>
186+
<i
187+
class="battery-0-2-1 severityNone-0-2-2"
188+
data-ouia-component-id="Severity-icon"
189+
title=" "
190+
widget-id=""
191+
widget-type="Severity"
192+
>
193+
<svg
194+
aria-hidden="true"
195+
class="pf-v6-svg"
196+
fill="currentColor"
197+
height="1em"
198+
role="img"
199+
viewBox="0 0 1024 1024"
200+
width="1em"
201+
>
202+
<path
203+
d="M640,384h320c35.3,0,64,28.7,64,64v64c0,35.3-28.7,64-64,64h-320c-35.3,0-64-28.7-64-64v-64c0-35.3,28.7-64,64-64ZM64,384h320c35.3,0,64,28.7,64,64v64c0,35.3-28.7,64-64,64H64c-35.3,0-64-28.7-64-64v-64c0-35.3,28.7-64,64-64Z"
204+
/>
205+
</svg>
206+
</i>
207+
<span>
208+
209+
210+
</span>
211+
</div>
212+
`;

0 commit comments

Comments
 (0)