Skip to content

Commit

Permalink
Attempting to fix build (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerac4 authored Jan 14, 2025
1 parent a899302 commit cf11535
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
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

0 comments on commit cf11535

Please sign in to comment.