Skip to content

Commit

Permalink
fix: add flushPromises to all SelectVitalEvent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Dec 18, 2024
1 parent 5084029 commit 53f85ba
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ describe('when user is selecting the vital event', () => {

describe('when user is in vital event selection view', () => {
beforeEach(async () => {
await flushPromises()
router.navigate(SELECT_VITAL_EVENT, { replace: true })
await waitForElement(app, '#select_vital_event_view')
})
it('lists the options', () => {
expect(app.find('#select_vital_event_view').hostNodes()).toHaveLength(1)
})
describe('when selects "Birth"', () => {
beforeEach(() => {
beforeEach(async () => {
await flushPromises()
app.find('#select_birth_event').hostNodes().simulate('change')
app.find('#continue').hostNodes().simulate('click')
app.update()
Expand All @@ -48,7 +50,8 @@ describe('when user is selecting the vital event', () => {
})

describe('when selects "Death"', () => {
beforeEach(() => {
beforeEach(async () => {
await flushPromises()
app.find('#select_death_event').hostNodes().simulate('change')
app.find('#continue').hostNodes().simulate('click')
})
Expand All @@ -58,7 +61,8 @@ describe('when user is selecting the vital event', () => {
})

describe('when no event is selected', () => {
beforeEach(() => {
beforeEach(async () => {
await flushPromises()
app.find('#continue').hostNodes().simulate('click')
})
it('shows the required error to user', () => {
Expand Down

0 comments on commit 53f85ba

Please sign in to comment.