Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to fix build #28

Merged
merged 8 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import userEvent from '@testing-library/user-event';
import { act } from 'react';

import { Route, createRoutesFromChildren } from 'react-router';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';

import useWindowSize from '~/core/hooks/useWindowSize';
import ForgotPasswordView from '~/features/authentication/public/ForgotPasswordView';
Expand All @@ -23,6 +24,10 @@ describe('ForgotPasswordView', () => {
});
});

afterEach(() => {
vi.clearAllMocks();
});

it('renders forgot password form elements', () => {
renderRoutes(
'memory',
Expand Down Expand Up @@ -68,7 +73,10 @@ describe('ForgotPasswordView', () => {
);

const loginLink = screen.getByText('Back to Login');
await user.click(loginLink);

await act(async () => {
await user.click(loginLink);
});

await waitFor(async () => {
return expect(screen.getByRole('button', { name: /sign in/i })).toBeInTheDocument();
Expand Down Expand Up @@ -130,7 +138,9 @@ describe('ForgotPasswordView', () => {
expect(screen.getByTestId('Brightness4Icon')).toBeInTheDocument();

// Click to toggle to dark mode
await user.click(toggleButton);
await act(async () => {
await user.click(toggleButton);
});

expect(screen.getByTestId('Brightness7Icon')).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ describe('LoginView', () => {

const forgotPasswordLink = screen.getByText('Forgot password?');

await user.click(forgotPasswordLink);
await act(async () => {
await user.click(forgotPasswordLink);
});

await waitFor(async () => {
return expect(screen.getByText(/Reset Password/i)).toBeInTheDocument();
Expand Down
Loading