From fded8cb7b0e32f3247b2df7dcb159f12ffe0bb95 Mon Sep 17 00:00:00 2001 From: Emma Mansell <73774046+7emansell@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:49:25 -0500 Subject: [PATCH] Updating tests accordingly --- src/components/MyAccount/Settings/EmailForm.test.tsx | 8 +++++--- src/components/MyAccount/Settings/PhoneForm.test.tsx | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/MyAccount/Settings/EmailForm.test.tsx b/src/components/MyAccount/Settings/EmailForm.test.tsx index cd3c8d0f4..65ce005ad 100644 --- a/src/components/MyAccount/Settings/EmailForm.test.tsx +++ b/src/components/MyAccount/Settings/EmailForm.test.tsx @@ -67,7 +67,9 @@ describe("email form", () => { fireEvent.click(screen.getByRole("button", { name: /edit/i })) await waitFor(() => - expect(screen.getByLabelText("Update email address 2")).toHaveFocus() + expect( + screen.getByLabelText("Update primary email address") + ).toHaveFocus() ) fireEvent.click(screen.getByRole("button", { name: /cancel/i })) @@ -82,7 +84,7 @@ describe("email form", () => { await waitFor(() => expect(screen.getAllByRole("textbox")[2]).toHaveFocus()) - fireEvent.click(screen.getAllByLabelText("Remove email")[1]) + fireEvent.click(screen.getByLabelText("Remove email 2")) await waitFor(() => expect(screen.getAllByRole("textbox")[1]).toHaveFocus()) }) @@ -121,7 +123,7 @@ describe("email form", () => { fireEvent.click(screen.getByRole("button", { name: /edit/i })) - fireEvent.click(screen.getByLabelText("Remove email")) + fireEvent.click(screen.getByLabelText("Remove email 2")) expect( screen.queryByDisplayValue("spaghettigrandma@gmail.com") diff --git a/src/components/MyAccount/Settings/PhoneForm.test.tsx b/src/components/MyAccount/Settings/PhoneForm.test.tsx index 160574f94..da519650f 100644 --- a/src/components/MyAccount/Settings/PhoneForm.test.tsx +++ b/src/components/MyAccount/Settings/PhoneForm.test.tsx @@ -84,7 +84,7 @@ describe("phone form", () => { await waitFor(() => expect(screen.getAllByRole("textbox")[1]).toHaveFocus()) - fireEvent.click(screen.getByLabelText("Remove phone")) + fireEvent.click(screen.getByLabelText("Remove phone 2")) await waitFor(() => expect(screen.getByRole("textbox")).toHaveFocus()) }) @@ -135,7 +135,7 @@ describe("phone form", () => { processedPatron.phones.length + 1 ) - fireEvent.click(screen.getByLabelText("Remove phone")) + fireEvent.click(screen.getByLabelText("Remove phone 2")) expect(screen.getAllByRole("textbox").length).toBe( processedPatron.phones.length )