Skip to content

Commit

Permalink
DAH-2625 update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tallulahkay committed Sep 12, 2024
1 parent 77f5132 commit 6161236
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion app/javascript/__tests__/pages/account/account-settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,23 @@ describe("<AccountSettingsPage />", () => {
await promise
})

expect(getByText("Your changes have been saved.")).not.toBeNull()

await act(async () => {
const closeButton = screen.getByLabelText("Close")
fireEvent.click(closeButton)

await promise
})

expect(
queryByText("We will update any applications you have not submitted yet.")
queryByText(
"We sent you an email. Check your email and follow the link to finish changing your information."
)
).toBeNull()

expect(queryByText("Your changes have been saved.")).toBeNull()

expect(authenticatedPut).toHaveBeenCalledWith(
"/api/v1/account/update",
expect.objectContaining({
Expand Down Expand Up @@ -265,6 +278,19 @@ describe("<AccountSettingsPage />", () => {
)
).not.toBeNull()

await act(async () => {
const closeButton = screen.getByLabelText("Close")
fireEvent.click(closeButton)

await promise
})

expect(
queryByText(
"We sent you an email. Check your email and follow the link to finish changing your information."
)
).toBeNull()

expect(authenticatedPut).toHaveBeenCalledWith(
"/api/v1/auth",
expect.objectContaining({
Expand Down

0 comments on commit 6161236

Please sign in to comment.