Skip to content

Commit

Permalink
Add tests for non-enterprise case
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmurray-codecov committed Jan 29, 2025
1 parent 28bc8f0 commit 43db784
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/pages/MembersPage/MembersActivation/MembersActivation.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,48 @@ describe('Members Activation', () => {
})
})
})

describe('user is not in an enterprise org', () => {
describe('and they are not an admin', () => {
it('renders auto activate component', async () => {
setup(
{ ...mockedAccountDetails, planAutoActivate: true },
TrialStatuses.NOT_STARTED,
Plans.USERS_PR_INAPPM,
false,
false
)

render(<MembersActivation />, { wrapper })

await waitFor(() => queryClient.isFetching)
await waitFor(() => !queryClient.isFetching)

const AutoActivate = await screen.findByText(/AutoActivate/)
expect(AutoActivate).toBeInTheDocument()
})
})

describe.only('and they are an admin', () => {
it('renders auto activate component', async () => {
setup(
{ ...mockedAccountDetails, planAutoActivate: true },
TrialStatuses.NOT_STARTED,
Plans.USERS_PR_INAPPM,
false,
true
)

render(<MembersActivation />, { wrapper })

await waitFor(() => queryClient.isFetching)
await waitFor(() => !queryClient.isFetching)

const AutoActivate = await screen.findByText(/AutoActivate/)
expect(AutoActivate).toBeInTheDocument()
})
})
})
})
})
})

0 comments on commit 43db784

Please sign in to comment.