Skip to content

Commit

Permalink
test: added test case for license-activation-page
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeramin committed Nov 27, 2024
1 parent 7159cfd commit 9de4713
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/components/app/Layout.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ describe('Layout', () => {
expect(screen.getByText('404', { selector: 'h1' })).toBeInTheDocument();
});

it('renders the license activation route when user is not linked to enterprise customer but accessing license activation', () => {
useEnterpriseCustomer.mockReturnValue({ data: null });

renderWithRouterProvider({
path: '/:enterpriseSlug/*',
element: <LayoutWrapper />,
children: [
{
path: 'licenses/:activationKey/activate',
element: <div data-testid="license-activation-page" />,
},
],
}, {
initialEntries: ['/enterprise-slug/licenses/12345678-1234-5678-1234-567812345678/activate'],
});

// Verify license activation page is rendered
expect(screen.getByTestId('license-activation-page')).toBeInTheDocument();
// Verify 404 is not rendered
expect(screen.queryByRole('heading', { name: '404' })).not.toBeInTheDocument();
});

it.each([
{
isSystemMaintenanceAlertOpen: false,
Expand Down

0 comments on commit 9de4713

Please sign in to comment.