Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben <rubdeivis@gmail.com>
  • Loading branch information
rubenguc committed Jul 31, 2023
1 parent f6d2d1e commit 33ea7a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 40 deletions.
22 changes: 6 additions & 16 deletions src/pages/balance/components/ChainSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,16 @@ describe("ChainSelector", () => {
act(() => {
fireEvent.click(button);
});
await waitFor(
() => {
expect(getByText(CHAINS[0].chains[0].name)).toBeDefined();
},
{
timeout: 10000,
}
);
await waitFor(() => {
expect(getByText(CHAINS[0].chains[0].name)).toBeDefined();
});
const account = getByText(CHAINS[0].chains[0].name);

act(() => {
fireEvent.click(account.parentElement as HTMLElement);
});
await waitFor(
() => {
expect(setSelectNetwork).toHaveBeenCalled();
},
{
timeout: 10000,
}
);
await waitFor(() => {
expect(setSelectNetwork).toHaveBeenCalled();
});
});
});
33 changes: 9 additions & 24 deletions src/pages/send/components/WasmForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,9 @@ describe("WasmForm", () => {

const { getByText } = renderComponent();
const button = getByText(en.send.continue) as HTMLButtonElement;
await waitFor(
() => {
expect(button.disabled).toEqual(false);
},
{
timeout: 10000,
}
);
await waitFor(() => {
expect(button.disabled).toEqual(false);
});
act(() => {
fireEvent.click(button);
});
Expand Down Expand Up @@ -297,14 +292,9 @@ describe("WasmForm", () => {

const { getByText } = renderComponent();
const button = getByText(en.send.continue) as HTMLButtonElement;
await waitFor(
() => {
expect(button.disabled).toEqual(false);
},
{
timeout: 10000,
}
);
await waitFor(() => {
expect(button.disabled).toEqual(false);
});
act(() => {
fireEvent.click(button);
});
Expand Down Expand Up @@ -369,14 +359,9 @@ describe("WasmForm", () => {

const { getByText } = renderComponent();
const button = getByText(en.send.continue) as HTMLButtonElement;
await waitFor(
() => {
expect(button.disabled).toEqual(false);
},
{
timeout: 10000,
}
);
await waitFor(() => {
expect(button.disabled).toEqual(false);
});
act(() => {
fireEvent.click(button);
});
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if (isProduction) {

export default defineConfig({
test: {
testTimeout: 10000,
globals: true,
environment: "jsdom",
setupFiles: "src/tests/setup.ts",
Expand Down

0 comments on commit 33ea7a5

Please sign in to comment.