mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
test(client): follow the password checklist and the labelled modal close in three suites
This commit is contained in:
@@ -301,7 +301,7 @@ describe('AdminPage', () => {
|
||||
|
||||
fireEvent.change(screen.getByPlaceholderText('Username'), { target: { value: 'newuser' } });
|
||||
fireEvent.change(screen.getByPlaceholderText('Email'), { target: { value: 'newuser@example.com' } });
|
||||
fireEvent.change(screen.getByPlaceholderText('Password'), { target: { value: 'securepassword123' } });
|
||||
fireEvent.change(screen.getByPlaceholderText('Password'), { target: { value: 'SecurePassw0rd!23' } });
|
||||
|
||||
// The modal footer has a second "Create User" button
|
||||
const createButtons = screen.getAllByRole('button', { name: /create user/i });
|
||||
|
||||
@@ -388,7 +388,8 @@ describe('LoginPage', () => {
|
||||
await user.click(screen.getByRole('button', { name: /update password/i }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/at least 8/i)).toBeInTheDocument();
|
||||
// The error, not the checklist line under the field that says the same rule.
|
||||
expect(screen.getByText('Password must be at least 8 characters')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -641,7 +642,8 @@ describe('LoginPage', () => {
|
||||
await user.click(screen.getByRole('button', { name: /create account/i }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/at least 8/i)).toBeInTheDocument();
|
||||
// The error, not the checklist line under the field that says the same rule.
|
||||
expect(screen.getByText('Password must be at least 8 characters')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user