Skip to content

Commit

Permalink
add missing input test in allergy form
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiMadlener committed Nov 8, 2024
1 parent ab75f2c commit 4e026ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/AllergyForm/AllergyForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,21 @@ describe('AllergyForm', () => {
]
render(<AllergyForm medicationClasses={medicationClasses} onSubmit={onSubmit} />)

const allergyTypeSelector = screen.getByText('Type', { selector: 'label' })
expect(allergyTypeSelector).toBeInTheDocument()

const medicationSelector = screen.getByRole('combobox', { name: 'Medication' })
expect(medicationSelector).toBeInTheDocument()

const clinicalStatusSelector = screen.getByText('Clinical Status', { selector: 'label' })
expect(clinicalStatusSelector).toBeInTheDocument()

const criticalitySelector = screen.getByText('Criticality', { selector: 'label' })
expect(criticalitySelector).toBeInTheDocument()

const button = screen.getByRole('button', { name: 'Create allergy' })
expect(button).toBeInTheDocument()

medicationSelector.click()
expect(screen.getByText('Lisinopril')).toBeInTheDocument()
})
Expand Down

0 comments on commit 4e026ae

Please sign in to comment.