Skip to content

Commit

Permalink
Adding another one back in
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerac4 committed Jan 14, 2025
1 parent b2a7717 commit 8205020
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions app/src/features/authentication/public/__tests__/LoginView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,39 @@ describe('LoginView', () => {
expect(screen.getByText('Create Account')).toHaveAttribute('href', '/create-account');
});

// it('toggles password visibility when show/hide button is clicked', async () => {
// const user = userEvent.setup();
// renderRoutes(
// 'memory',
// createRoutesFromChildren(
// <>
// <Route element={<Login />} path="/login" />
// <Route element={<ForgotPasswordView />} path="/forgot-password" />
// </>
// ),
// '/login'
// );
// const passwordInput = screen.getByLabelText(/Password/i, { selector: 'input' });
// expect(passwordInput).toHaveAttribute('type', 'password');
it('toggles password visibility when show/hide button is clicked', async () => {
const user = userEvent.setup();
renderRoutes(
'memory',
createRoutesFromChildren(
<>
<Route element={<Login />} path="/login" />
<Route element={<ForgotPasswordView />} path="/forgot-password" />
</>
),
'/login'
);
const passwordInput = screen.getByLabelText(/Password/i, { selector: 'input' });
expect(passwordInput).toHaveAttribute('type', 'password');

// const toggleButton = screen.getByRole('button', { name: /toggle password visibility/i });
const toggleButton = screen.getByRole('button', { name: /toggle password visibility/i });

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

// await waitFor(() => {
// return expect(passwordInput).toHaveAttribute('type', 'text');
// });
await waitFor(() => {
return expect(passwordInput).toHaveAttribute('type', 'text');
});

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

// await waitFor(() => {
// return expect(passwordInput).toHaveAttribute('type', 'password');
// });
// });
await waitFor(() => {
return expect(passwordInput).toHaveAttribute('type', 'password');
});
});

// it('displays GSplash when isDesktop is true', () => {
// renderRoutes(
Expand Down

0 comments on commit 8205020

Please sign in to comment.