Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 284c3a3

Browse files
author
Shammamah Hossain
committed
Update loading component tests.
1 parent a09a508 commit 284c3a3

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tests/unit/Loading.test.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ test('Loading renders', () => {
1414
</Loading>
1515
);
1616

17-
expect(loading.html()).toMatchSnapshot('Loading with is_loading=true');
17+
expect(
18+
loading
19+
.find('.dash-spinner')
20+
.parent()
21+
.html()
22+
).toMatchSnapshot('Loading with is_loading=true');
1823
});
1924
test('Loading renders without loading_state', () => {
2025
const loading = render(
@@ -49,7 +54,12 @@ test('Loading renders without prop_name', () => {
4954
</Loading>
5055
);
5156

52-
expect(loading.html()).toMatchSnapshot('Loading with is_loading=true');
57+
expect(
58+
loading
59+
.find('.dash-spinner')
60+
.parent()
61+
.html()
62+
).toMatchSnapshot('Loading with is_loading=true');
5363
});
5464
test('Loading renders without loading_state.component_name', () => {
5565
const statusMock = {
@@ -62,7 +72,12 @@ test('Loading renders without loading_state.component_name', () => {
6272
</Loading>
6373
);
6474

65-
expect(loading.html()).toMatchSnapshot('Loading with is_loading=true');
75+
expect(
76+
loading
77+
.find('.dash-spinner')
78+
.parent()
79+
.html()
80+
).toMatchSnapshot('Loading with is_loading=true');
6681
});
6782
test('Loading renders with multiple children', () => {
6883
const statusMock = {
@@ -78,7 +93,12 @@ test('Loading renders with multiple children', () => {
7893
</Loading>
7994
);
8095

81-
expect(loading.html()).toMatchSnapshot('Loading with is_loading=true');
96+
expect(
97+
loading
98+
.find('.dash-spinner')
99+
.parent()
100+
.html()
101+
).toMatchSnapshot('Loading with is_loading=true');
82102
});
83103

84104
test("Loading checks all it's children for a loading_state", () => {

0 commit comments

Comments
 (0)