Skip to content

Commit 24496cc

Browse files
authored
Fix the unit tests on Kibana 7.16.x-7.17.x (#4713)
* fix(tests): fix the script and configuration to run the unit tests * fix(tests): fix tests * fix(tests): remove a setupFiles file from the jest configuration
1 parent 44ca2d5 commit 24496cc

File tree

19 files changed

+852
-1040
lines changed

19 files changed

+852
-1040
lines changed

public/components/agents/stats/__snapshots__/table.test.tsx.snap

+102-71
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
3030
>
3131
<EuiPanel>
3232
<div
33-
className="euiPanel euiPanel--paddingMedium"
33+
className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
3434
>
3535
<EuiFlexGroup
3636
justifyContent="spaceBetween"
@@ -66,25 +66,9 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
6666
<EuiIcon
6767
type="calendar"
6868
>
69-
<EuiIconEmpty
70-
aria-hidden={true}
71-
className="euiIcon euiIcon--medium euiIcon-isLoading"
72-
focusable="false"
73-
role="img"
74-
style={null}
75-
>
76-
<svg
77-
aria-hidden={true}
78-
className="euiIcon euiIcon--medium euiIcon-isLoading"
79-
focusable="false"
80-
height={16}
81-
role="img"
82-
style={null}
83-
viewBox="0 0 16 16"
84-
width={16}
85-
xmlns="http://www.w3.org/2000/svg"
86-
/>
87-
</EuiIconEmpty>
69+
<span
70+
data-euiicon-type="calendar"
71+
/>
8872
</EuiIcon>
8973
Start:
9074
@@ -153,7 +137,12 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
153137
}
154138
items={Array []}
155139
loading={false}
156-
noItemsMessage="No items found"
140+
noItemsMessage={
141+
<EuiI18n
142+
default="No items found"
143+
token="euiBasicTable.noItemsMessage"
144+
/>
145+
}
157146
onChange={[Function]}
158147
pagination={
159148
Object {
@@ -243,18 +232,34 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
243232
}
244233
}
245234
>
246-
<div
235+
<CellContents
247236
className="euiTableCellContent"
237+
showSortMsg={false}
248238
>
249-
<EuiInnerText>
250-
<span
251-
className="euiTableCellContent__text"
252-
title="Location"
253-
>
254-
Location
255-
</span>
256-
</EuiInnerText>
257-
</div>
239+
<span
240+
className="euiTableCellContent"
241+
>
242+
<EuiInnerText>
243+
<EuiI18n
244+
default="{innerText}; {description}"
245+
token="euiTableHeaderCell.titleTextWithDesc"
246+
values={
247+
Object {
248+
"description": undefined,
249+
"innerText": "Location",
250+
}
251+
}
252+
>
253+
<span
254+
className="euiTableCellContent__text"
255+
title="Location"
256+
>
257+
Location
258+
</span>
259+
</EuiI18n>
260+
</EuiInnerText>
261+
</span>
262+
</CellContents>
258263
</th>
259264
</EuiTableHeaderCell>
260265
<EuiTableHeaderCell
@@ -273,18 +278,34 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
273278
}
274279
}
275280
>
276-
<div
281+
<CellContents
277282
className="euiTableCellContent"
283+
showSortMsg={false}
278284
>
279-
<EuiInnerText>
280-
<span
281-
className="euiTableCellContent__text"
282-
title="Events"
283-
>
284-
Events
285-
</span>
286-
</EuiInnerText>
287-
</div>
285+
<span
286+
className="euiTableCellContent"
287+
>
288+
<EuiInnerText>
289+
<EuiI18n
290+
default="{innerText}; {description}"
291+
token="euiTableHeaderCell.titleTextWithDesc"
292+
values={
293+
Object {
294+
"description": undefined,
295+
"innerText": "Events",
296+
}
297+
}
298+
>
299+
<span
300+
className="euiTableCellContent__text"
301+
title="Events"
302+
>
303+
Events
304+
</span>
305+
</EuiI18n>
306+
</EuiInnerText>
307+
</span>
308+
</CellContents>
288309
</th>
289310
</EuiTableHeaderCell>
290311
<EuiTableHeaderCell
@@ -303,18 +324,34 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
303324
}
304325
}
305326
>
306-
<div
327+
<CellContents
307328
className="euiTableCellContent"
329+
showSortMsg={false}
308330
>
309-
<EuiInnerText>
310-
<span
311-
className="euiTableCellContent__text"
312-
title="Bytes"
313-
>
314-
Bytes
315-
</span>
316-
</EuiInnerText>
317-
</div>
331+
<span
332+
className="euiTableCellContent"
333+
>
334+
<EuiInnerText>
335+
<EuiI18n
336+
default="{innerText}; {description}"
337+
token="euiTableHeaderCell.titleTextWithDesc"
338+
values={
339+
Object {
340+
"description": undefined,
341+
"innerText": "Bytes",
342+
}
343+
}
344+
>
345+
<span
346+
className="euiTableCellContent__text"
347+
title="Bytes"
348+
>
349+
Bytes
350+
</span>
351+
</EuiI18n>
352+
</EuiInnerText>
353+
</span>
354+
</CellContents>
318355
</th>
319356
</EuiTableHeaderCell>
320357
</tr>
@@ -346,7 +383,12 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
346383
<span
347384
className="euiTableCellContent__text"
348385
>
349-
No items found
386+
<EuiI18n
387+
default="No items found"
388+
token="euiBasicTable.noItemsMessage"
389+
>
390+
No items found
391+
</EuiI18n>
350392
</span>
351393
</div>
352394
</td>
@@ -394,6 +436,7 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
394436
<EuiButtonContent
395437
className="euiButtonEmpty__content"
396438
iconSide="left"
439+
iconSize="m"
397440
iconType="importAction"
398441
textProps={
399442
Object {
@@ -406,28 +449,16 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
406449
>
407450
<EuiIcon
408451
className="euiButtonContent__icon"
452+
color="inherit"
409453
size="m"
410454
type="importAction"
411455
>
412-
<EuiIconEmpty
413-
aria-hidden={true}
414-
className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonContent__icon"
415-
focusable="false"
416-
role="img"
417-
style={null}
418-
>
419-
<svg
420-
aria-hidden={true}
421-
className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonContent__icon"
422-
focusable="false"
423-
height={16}
424-
role="img"
425-
style={null}
426-
viewBox="0 0 16 16"
427-
width={16}
428-
xmlns="http://www.w3.org/2000/svg"
429-
/>
430-
</EuiIconEmpty>
456+
<span
457+
className="euiButtonContent__icon"
458+
color="inherit"
459+
data-euiicon-type="importAction"
460+
size="m"
461+
/>
431462
</EuiIcon>
432463
<span
433464
className="euiButtonEmpty__text"

public/components/common/error-boundary/__snapshots__/error-boundary.test.tsx.snap

+17-30
Original file line numberDiff line numberDiff line change
@@ -57,48 +57,35 @@ exports[`ErrorBoundary component renders correctly to match the snapshot 1`] = `
5757
size="xxl"
5858
type="faceSad"
5959
>
60-
<EuiIconEmpty
61-
aria-hidden={true}
62-
className="euiIcon euiIcon--xxLarge euiIcon--subdued euiIcon-isLoading"
63-
focusable="false"
64-
role="img"
65-
style={null}
66-
>
67-
<svg
68-
aria-hidden={true}
69-
className="euiIcon euiIcon--xxLarge euiIcon--subdued euiIcon-isLoading"
70-
focusable="false"
71-
height={16}
72-
role="img"
73-
style={null}
74-
viewBox="0 0 16 16"
75-
width={16}
76-
xmlns="http://www.w3.org/2000/svg"
77-
/>
78-
</EuiIconEmpty>
60+
<span
61+
color="subdued"
62+
data-euiicon-type="faceSad"
63+
size="xxl"
64+
/>
7965
</EuiIcon>
8066
<EuiSpacer
81-
size="s"
67+
size="m"
8268
>
8369
<div
84-
className="euiSpacer euiSpacer--s"
70+
className="euiSpacer euiSpacer--m"
8571
/>
8672
</EuiSpacer>
73+
<EuiTitle
74+
size="m"
75+
>
76+
<h2
77+
className="euiTitle euiTitle--medium"
78+
>
79+
Something went wrong.
80+
</h2>
81+
</EuiTitle>
8782
<EuiTextColor
8883
color="subdued"
8984
>
9085
<span
9186
className="euiTextColor euiTextColor--subdued"
87+
style={Object {}}
9288
>
93-
<EuiTitle
94-
size="m"
95-
>
96-
<h2
97-
className="euiTitle euiTitle--medium"
98-
>
99-
Something went wrong.
100-
</h2>
101-
</EuiTitle>
10289
<EuiSpacer
10390
size="m"
10491
>

public/components/common/hocs/error-boundary/__snapshots__/with-error-boundary.test.tsx.snap

+17-30
Original file line numberDiff line numberDiff line change
@@ -62,48 +62,35 @@ exports[`withErrorBoundary hoc implementation renders correctly to match the sna
6262
size="xxl"
6363
type="faceSad"
6464
>
65-
<EuiIconEmpty
66-
aria-hidden={true}
67-
className="euiIcon euiIcon--xxLarge euiIcon--subdued euiIcon-isLoading"
68-
focusable="false"
69-
role="img"
70-
style={null}
71-
>
72-
<svg
73-
aria-hidden={true}
74-
className="euiIcon euiIcon--xxLarge euiIcon--subdued euiIcon-isLoading"
75-
focusable="false"
76-
height={16}
77-
role="img"
78-
style={null}
79-
viewBox="0 0 16 16"
80-
width={16}
81-
xmlns="http://www.w3.org/2000/svg"
82-
/>
83-
</EuiIconEmpty>
65+
<span
66+
color="subdued"
67+
data-euiicon-type="faceSad"
68+
size="xxl"
69+
/>
8470
</EuiIcon>
8571
<EuiSpacer
86-
size="s"
72+
size="m"
8773
>
8874
<div
89-
className="euiSpacer euiSpacer--s"
75+
className="euiSpacer euiSpacer--m"
9076
/>
9177
</EuiSpacer>
78+
<EuiTitle
79+
size="m"
80+
>
81+
<h2
82+
className="euiTitle euiTitle--medium"
83+
>
84+
Something went wrong.
85+
</h2>
86+
</EuiTitle>
9287
<EuiTextColor
9388
color="subdued"
9489
>
9590
<span
9691
className="euiTextColor euiTextColor--subdued"
92+
style={Object {}}
9793
>
98-
<EuiTitle
99-
size="m"
100-
>
101-
<h2
102-
className="euiTitle euiTitle--medium"
103-
>
104-
Something went wrong.
105-
</h2>
106-
</EuiTitle>
10794
<EuiSpacer
10895
size="m"
10996
>

0 commit comments

Comments
 (0)