Skip to content

Commit

Permalink
Updating tests accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
7emansell committed Dec 10, 2024
1 parent 15312dc commit fded8cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/MyAccount/Settings/EmailForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand All @@ -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())
})
Expand Down Expand Up @@ -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("[email protected]")
Expand Down
4 changes: 2 additions & 2 deletions src/components/MyAccount/Settings/PhoneForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit fded8cb

Please sign in to comment.