Skip to content

Commit 411a789

Browse files
committed
chore: merge wasm loading state tests
1 parent c606ce4 commit 411a789

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/client/App.test.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,27 @@ describe("App - Initial State Setup", () => {
8383
cleanup();
8484
});
8585

86-
it("should show the loading modal while the wasm module is loading", async () => {
86+
it("should show the loading modal while the wasm module is loading, and not show it once it has been loaded", async () => {
8787
render(<TestApp />);
8888

8989
await waitFor(() => {
9090
expect(screen.getByText("Loading assets"));
9191
});
92-
});
93-
94-
it("should call initWasm", async () => {
95-
render(<TestApp />);
9692

97-
await waitFor(() => {
93+
await waitFor(async () => {
9894
expect(initWasm).toHaveBeenCalled();
9995
});
96+
97+
expect(screen.queryByTestId("wasm-loading-modal")).toBeNull();
98+
expect(screen.queryByTestId("wasm-error-modal")).toBeNull();
10099
});
101100

102-
it("should not show the loading modal after the wasm has been loaded", async () => {
101+
it("should call initWasm", async () => {
103102
render(<TestApp />);
104103

105-
await waitFor(async () => {
104+
await waitFor(() => {
106105
expect(initWasm).toHaveBeenCalled();
107106
});
108-
109-
expect(screen.queryByTestId("wasm-loading-modal")).toBeNull();
110-
expect(screen.queryByTestId("wasm-error-modal")).toBeNull();
111107
});
112108

113109
it("should use the default example if `window.CODE` is not defined", async () => {

0 commit comments

Comments
 (0)