Skip to content

Commit

Permalink
clarify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pearl-truss committed May 13, 2024
1 parent e4459b6 commit 5be80db
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ describe('ProgramSelect', () => {
await selectEvent.openMenu(combobox)

await waitFor(() => {
expect(screen.getAllByText('MSHO')).toHaveLength(1)
expect(screen.getAllByText('SNBC')).toHaveLength(2)
expect(screen.getAllByText('PMAP')).toHaveLength(2)
expect(screen.getAllByText('MSC+')).toHaveLength(1)
expect(screen.getByText('MSHO')).toBeInTheDocument()
expect(screen.getByText('SNBC')).toBeInTheDocument()
expect(screen.getByText('SNBC Rate Program')).toBeInTheDocument()
expect(screen.getByText('PMAP')).toBeInTheDocument()
expect(screen.getByText('PMAP Rate Program')).toBeInTheDocument()
expect(screen.getByText('MSC+')).toBeInTheDocument()
})
})

Expand All @@ -102,10 +104,16 @@ describe('ProgramSelect', () => {
await selectEvent.openMenu(combobox)

await waitFor(() => {
expect(screen.getAllByText('MSHO')).toHaveLength(1)
expect(screen.getAllByText('SNBC')).toHaveLength(1)
expect(screen.getAllByText('PMAP')).toHaveLength(1)
expect(screen.getAllByText('MSC+')).toHaveLength(1)
expect(screen.getByText('MSHO')).toBeInTheDocument()
expect(screen.getByText('SNBC')).toBeInTheDocument()
expect(
screen.queryByText('SNBC Rate Program')
).not.toBeInTheDocument()
expect(screen.getByText('PMAP')).toBeInTheDocument()
expect(
screen.queryByText('PMAP Rate Program')
).not.toBeInTheDocument()
expect(screen.getByText('MSC+')).toBeInTheDocument()
})
})

Expand All @@ -131,10 +139,12 @@ describe('ProgramSelect', () => {
await selectEvent.openMenu(combobox)

await waitFor(() => {
expect(screen.getAllByText('MSHO')).toHaveLength(1)
expect(screen.getAllByText('SNBC')).toHaveLength(2)
expect(screen.getAllByText('PMAP')).toHaveLength(2)
expect(screen.getAllByText('MSC+')).toHaveLength(1)
expect(screen.getByText('MSHO')).toBeInTheDocument()
expect(screen.getByText('SNBC')).toBeInTheDocument()
expect(screen.getByText('SNBC Rate Program')).toBeInTheDocument()
expect(screen.getByText('PMAP')).toBeInTheDocument()
expect(screen.getByText('PMAP Rate Program')).toBeInTheDocument()
expect(screen.getByText('MSC+')).toBeInTheDocument()
})

await selectEvent.select(combobox, 'MSHO')
Expand Down Expand Up @@ -176,10 +186,12 @@ describe('ProgramSelect', () => {
await selectEvent.openMenu(combobox)

await waitFor(() => {
expect(screen.getAllByText('MSHO')).toHaveLength(1)
expect(screen.getAllByText('SNBC')).toHaveLength(2)
expect(screen.getAllByText('PMAP')).toHaveLength(2)
expect(screen.getAllByText('MSC+')).toHaveLength(1)
expect(screen.getByText('MSHO')).toBeInTheDocument()
expect(screen.getByText('SNBC')).toBeInTheDocument()
expect(screen.getByText('SNBC Rate Program')).toBeInTheDocument()
expect(screen.getByText('PMAP')).toBeInTheDocument()
expect(screen.getByText('PMAP Rate Program')).toBeInTheDocument()
expect(screen.getByText('MSC+')).toBeInTheDocument()
})

const removeMSHO = screen.getByLabelText('Remove MSHO')
Expand Down
4 changes: 2 additions & 2 deletions services/app-web/src/testHelpers/apolloMocks/stateMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function mockMNState(): State {
{
id: 'bab766a5-650e-4851-8fdf-6a420ffc41c1',
fullName: 'Minnesota Special Needs Basic Care',
name: 'SNBC',
name: 'SNBC Rate Program',
isRateProgram: true
},
{
id: '31ddd823-7c6e-46d9-bc31-e0b7d6389a43',
fullName: 'Prepaid Medical Assistance Program for Seniors',
name: 'PMAP',
name: 'PMAP Rate Program',
isRateProgram: true
},
],
Expand Down
2 changes: 1 addition & 1 deletion services/app-web/src/testHelpers/jestRateHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const fillOutIndexRate = async (screen: Screen, index: number) => {
selectEvent.openMenu(combobox)
await selectEvent.select(combobox, 'PMAP')
expect(
withinTargetRateCert.getAllByLabelText('Remove SNBC')[0]
withinTargetRateCert.getByLabelText('Remove SNBC')
).toBeInTheDocument()
expect(
withinTargetRateCert.getByLabelText('Remove PMAP')
Expand Down

0 comments on commit 5be80db

Please sign in to comment.