diff --git a/src/views/home/AccountsList.test.tsx b/src/views/home/AccountsList.test.tsx index 3a8fbcef58..d26364dcf6 100644 --- a/src/views/home/AccountsList.test.tsx +++ b/src/views/home/AccountsList.test.tsx @@ -8,7 +8,7 @@ import { mockPk, mockSocialAccount, } from "../../mocks/factories"; -import { act, render, screen, userEvent, within } from "../../mocks/testUtils"; +import { act, render, screen, userEvent, waitFor, within } from "../../mocks/testUtils"; import { MnemonicAccount } from "../../types/Account"; import { getDefaultDerivationPath } from "../../utils/account/derivationPathUtils"; import * as cryptoFunctionsToMock from "../../utils/crypto/AES"; @@ -64,8 +64,7 @@ describe("", () => { const { getByTestId, getByRole } = within(seedPhrase1); const cta = getByTestId(/^popover-cta$/i); await act(() => user.click(cta)); - - expect(getByRole("dialog")).toHaveTextContent("Remove"); + await waitFor(() => expect(getByRole("dialog")).toHaveTextContent("Remove")); const removeBtn = getByRole("button", { name: /^remove$/i });