Fix type errors in tests

This commit is contained in:
Alex Gleason 2024-09-25 19:51:34 -05:00
parent 5d37aa91d4
commit 66bc8ae30e
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 6 deletions

View File

@ -7,18 +7,18 @@ import LandingPageModal from './landing-page-modal';
describe('<LandingPageModal />', () => {
it('successfully renders', () => {
render(<LandingPageModal onClose={vi.fn} />);
render(<LandingPageModal onClose={() => {}} />);
expect(screen.getByTestId('modal')).toBeInTheDocument();
});
it('doesn\'t display the signup button by default', () => {
render(<LandingPageModal onClose={vi.fn} />);
render(<LandingPageModal onClose={() => {}} />);
expect(screen.queryByText('Register')).not.toBeInTheDocument();
});
describe('with registrations enabled', () => {
it('displays the signup button', () => {
render(<LandingPageModal onClose={vi.fn} />, undefined, storeOpen);
render(<LandingPageModal onClose={() => {}} />, undefined, storeOpen);
expect(screen.getByText('Register')).toBeInTheDocument();
});
});

View File

@ -7,18 +7,18 @@ import UnauthorizedModal from './unauthorized-modal';
describe('<UnauthorizedModal />', () => {
it('successfully renders', () => {
render(<UnauthorizedModal onClose={vi.fn} action='FOLLOW' />);
render(<UnauthorizedModal onClose={() => {}} action='FOLLOW' />);
expect(screen.getByTestId('modal')).toBeInTheDocument();
});
it('doesn\'t display the signup button by default', () => {
render(<UnauthorizedModal onClose={vi.fn} action='FOLLOW' />);
render(<UnauthorizedModal onClose={() => {}} action='FOLLOW' />);
expect(screen.queryByText('Sign up')).not.toBeInTheDocument();
});
describe('with registrations enabled', () => {
it('displays the signup button', () => {
render(<UnauthorizedModal onClose={vi.fn} action='FOLLOW' />, undefined, storeOpen);
render(<UnauthorizedModal onClose={() => {}} action='FOLLOW' />, undefined, storeOpen);
expect(screen.getByText('Sign up')).toBeInTheDocument();
});
});