-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update login form tests to use getByTestId instead of getByRole
- Loading branch information
1 parent
3e8597a
commit 051d4c1
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { render } from 'test/layout-test-utils'; | ||
import { render, getByTestId } from 'test/layout-test-utils'; | ||
import userEvent from '@testing-library/user-event'; | ||
import * as mockDataProvider from 'librechat-data-provider/react-query'; | ||
import type { TStartupConfig } from 'librechat-data-provider'; | ||
|
@@ -112,7 +112,7 @@ test('submits login form', async () => { | |
); | ||
const emailInput = getByLabelText(/email/i); | ||
const passwordInput = getByLabelText(/password/i); | ||
const submitButton = getByRole('button', { name: /Sign in/i }); | ||
const submitButton = getByTestId(document.body, 'login-button'); | ||
|
||
await userEvent.type(emailInput, '[email protected]'); | ||
await userEvent.type(passwordInput, 'password'); | ||
|
@@ -127,7 +127,7 @@ test('displays validation error messages', async () => { | |
); | ||
const emailInput = getByLabelText(/email/i); | ||
const passwordInput = getByLabelText(/password/i); | ||
const submitButton = getByRole('button', { name: /Sign in/i }); | ||
const submitButton = getByTestId(document.body, 'login-button'); | ||
|
||
await userEvent.type(emailInput, 'test'); | ||
await userEvent.type(passwordInput, 'pass'); | ||
|