Skip to content

Commit

Permalink
fix: unstable inquiry modal test (#10579)
Browse files Browse the repository at this point in the history
* fix: unstable inquiry modal test

* Update src/app/Scenes/Artwork/Components/CommercialButtons/InquiryModal.tests.tsx

Co-authored-by: Carlos <[email protected]>

---------

Co-authored-by: Carlos <[email protected]>
  • Loading branch information
MounirDhahri and araujobarret authored Aug 9, 2024
1 parent a67850c commit ee816a8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
InquiryQuestionIDs,
} from "app/utils/ArtworkInquiry/ArtworkInquiryTypes"
import { daysInCooldownPeriod } from "app/utils/collectorPromptHelpers"
import { flushPromiseQueue } from "app/utils/tests/flushPromiseQueue"
import { mockTrackEvent } from "app/utils/tests/globallyMockedStuff"
import { setupTestWrapper } from "app/utils/tests/setupTestWrapper"
import { Reducer, useReducer } from "react"
Expand Down Expand Up @@ -89,9 +90,10 @@ describe("inquiry modal", () => {

fireEvent.press(screen.getByText("Cancel"))

await waitFor(() => {
expect(screen.queryByText("What information are you looking for?")).toBeNull()
})
// Wait for the modal to close
await flushPromiseQueue()

expect(screen.queryByText("What information are you looking for?")).not.toBeOnTheScreen()
})

it("tracks an event when the inquiry modal is closed", async () => {
Expand Down

0 comments on commit ee816a8

Please sign in to comment.