Skip to content

Commit

Permalink
Fix/UI tests for multi select yes/no (#78)
Browse files Browse the repository at this point in the history
* fix: fix all tests broken because of auto progressing

* bump ui-library version to 0.1.15
  • Loading branch information
mohsinht authored Jul 11, 2023
1 parent 6a4f7e1 commit a1e13a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awell_health/ui-library",
"version": "0.1.13",
"version": "0.1.15",
"private": false,
"description": "UI components to integrate with Awell Health",
"repository": {
Expand Down Expand Up @@ -187,4 +187,4 @@
},
"homepage": "https://github.com/awell-health/ui-library#readme",
"_id": "@awell_health/[email protected]"
}
}
10 changes: 9 additions & 1 deletion src/hostedPages/activities/wizardForm/wizardForm.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,15 @@ describe('Wizard form', () => {
expect(radioOption).not.toBeChecked()

await act(async () => {
// clicking on a select option moves to next question
fireEvent.click(radioOption)
})

expect(radioOption).toBeChecked()

// GO back to 2nd question
await clickPrevButton()

// GO back to 1st question
await clickPrevButton()

Expand All @@ -150,7 +154,7 @@ describe('Wizard form', () => {
// Check if evaluate visibility conditions were called each time user
// navigates to NEXT question + 1 on init
await waitFor(() =>
expect(evaluateDisplayConditions).toHaveBeenCalledTimes(3)
expect(evaluateDisplayConditions).toHaveBeenCalledTimes(5)
)
})

Expand All @@ -176,10 +180,14 @@ describe('Wizard form', () => {
)
expect(radioOption).not.toBeChecked()
await act(async () => {
// clicking on a select option moves to next question
fireEvent.click(radioOption)
})
expect(radioOption).toBeChecked()

// GO back to 1st question
await clickPrevButton()

// Try going to 2nd question again
await clickNextButton()

Expand Down

0 comments on commit a1e13a1

Please sign in to comment.