Skip to content

Commit 9544c14

Browse files
committed
fix: anchor password regex in LoginForm test to avoid matching toggle button
1 parent 0f5f3b7 commit 9544c14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/modules/User/components/LoginForm.unit.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('<LoginForm/>', () => {
4747
const passwordTextElement = screen.getByText(/password/i);
4848
expect(passwordTextElement).toBeInTheDocument();
4949

50-
const passwordInputElement = screen.getByLabelText(/password/i);
50+
const passwordInputElement = screen.getByLabelText(/^password$/i);
5151
expect(passwordInputElement).toBeInTheDocument();
5252

5353
const loginButtonElement = screen.getByRole('button', {
@@ -67,7 +67,7 @@ describe('<LoginForm/>', () => {
6767
}
6868
});
6969

70-
const passwordElement = screen.getByLabelText(/password/i);
70+
const passwordElement = screen.getByLabelText(/^password$/i);
7171

7272
fireEvent.change(passwordElement, {
7373
target: {

0 commit comments

Comments
 (0)