Skip to content

Commit

Permalink
chore: Update login form tests to use getByTestId instead of getByRole
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Dec 23, 2024
1 parent 3e8597a commit 051d4c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/components/Auth/__tests__/LoginForm.spec.tsx
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';
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 051d4c1

Please sign in to comment.