Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmurray-codecov committed May 9, 2024
1 parent c74c4aa commit f5aeccd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ describe('ActivationBanner', () => {
value = 'users-basic',
hasSeatsLeft = true
) {
const getPlanData = jest.fn()
server.use(
graphql.query('GetPlanData', (req, res, ctx) => {
getPlanData()
return res(
ctx.status(200),
ctx.data({
Expand All @@ -83,6 +85,7 @@ describe('ActivationBanner', () => {
)
})
)
return { getPlanData }
}

it('renders trial eligible banner if user is eligible to trial', async () => {
Expand All @@ -94,11 +97,10 @@ describe('ActivationBanner', () => {
})

it('does not render trial eligible banner if user is not eligible to trial', async () => {
setup(false, 'ONGOING', 'users-basic', true)
const { getPlanData } = setup(false, 'ONGOING', 'users-basic', true)
const { container } = render(<ActivationBanner />, { wrapper })

await waitFor(() => queryClient.isFetching)
await waitFor(() => !queryClient.isFetching)
await waitFor(() => expect(getPlanData).toHaveBeenCalled())

await waitFor(() => expect(container).toBeEmptyDOMElement())
})
Expand Down

0 comments on commit f5aeccd

Please sign in to comment.