Adds profile and settings pages
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { renderApp, mockGuest } from '@/test/utils';
|
||||
import { _resetSetupStatusCache } from '@/router';
|
||||
|
||||
beforeEach(() => {
|
||||
_resetSetupStatusCache();
|
||||
});
|
||||
|
||||
describe('AccessDeniedPage', () => {
|
||||
it('renders the 403 title and message', async () => {
|
||||
renderApp('/403');
|
||||
|
||||
expect(await screen.findByTestId('access-denied-title', {}, { timeout: 5000 })).toBeInTheDocument();
|
||||
expect(screen.getByTestId('access-denied-message')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the back to dashboard button', async () => {
|
||||
renderApp('/403');
|
||||
|
||||
expect(await screen.findByTestId('access-denied-back-button', {}, { timeout: 5000 })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('navigates to login when back button is clicked as guest', async () => {
|
||||
mockGuest();
|
||||
renderApp('/403');
|
||||
|
||||
const button = await screen.findByTestId('access-denied-back-button', {}, { timeout: 5000 });
|
||||
await userEvent.click(button);
|
||||
|
||||
expect(await screen.findByTestId('login-form-submit-button')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user