diff --git a/src/components/CalculateButton/CalculateButton.test.tsx b/src/components/CalculateButton/CalculateButton.test.tsx index fe0c4d3..8058a32 100644 --- a/src/components/CalculateButton/CalculateButton.test.tsx +++ b/src/components/CalculateButton/CalculateButton.test.tsx @@ -55,12 +55,12 @@ describe("CalculateButton", () => { }); await userEvent.click(button); - const button2 = screen.getByRole("button", { + await userEvent.click(button); + + const button2 = await screen.findByRole("button", { name: "select type of operation on item value", }); - await userEvent.click(button); - expect(button2).not.toBeInTheDocument(); }); @@ -70,12 +70,12 @@ describe("CalculateButton", () => { }); await userEvent.click(button); - const button2 = screen.getByRole("button", { + await userEvent.type(screen.getByLabelText("add"), "{Escape}"); + + const button2 = await screen.findByRole("button", { name: "select type of operation on item value", }); - await userEvent.type(screen.getByLabelText("addition"), "{Escape}"); - expect(button2).not.toBeInTheDocument(); });