Skip to content

Commit 513b23f

Browse files
committed
fix: Update test query matchers
1 parent 15d416a commit 513b23f

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

packages/react/src/auth/forms/email-link-auth-form.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ export function EmailLinkAuthForm({ onEmailSent, onSignIn }: EmailLinkAuthFormPr
113113
>
114114
<form.AppForm>
115115
<fieldset>
116-
<form.AppField name="email">{(field) => <field.Input label="Email" type="email" />}</form.AppField>
116+
<form.AppField name="email">
117+
{(field) => <field.Input label={getTranslation(ui, "labels", "emailAddress")} type="email" />}
118+
</form.AppField>
117119
</fieldset>
118120
<Policies />
119121
<fieldset>

packages/react/src/auth/forms/forgot-password-auth-form.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export function ForgotPasswordAuthForm({ onBackToSignInClick, onPasswordSent }:
9393
>
9494
<form.AppForm>
9595
<fieldset>
96-
<form.AppField name="email">{(field) => <field.Input label="Email" type="email" />}</form.AppField>
96+
<form.AppField name="email">
97+
{(field) => <field.Input label={getTranslation(ui, "labels", "emailAddress")} type="email" />}
98+
</form.AppField>
9799
</fieldset>
98100
<Policies />
99101
<fieldset>

packages/react/src/auth/forms/sign-in-auth-form.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ export function SignInAuthForm({ onSignIn, onForgotPasswordClick, onRegisterClic
8888
>
8989
<form.AppForm>
9090
<fieldset>
91-
<form.AppField name="email">{(field) => <field.Input label="Email" type="email" />}</form.AppField>
91+
<form.AppField name="email">
92+
{(field) => <field.Input label={getTranslation(ui, "labels", "emailAddress")} type="email" />}
93+
</form.AppField>
9294
</fieldset>
9395
<fieldset>
9496
<form.AppField name="password">
9597
{(field) => (
96-
<field.Input label="Password" type="password">
98+
<field.Input label={getTranslation(ui, "labels", "password")} type="password">
9799
{onForgotPasswordClick ? (
98100
<form.Action onClick={onForgotPasswordClick}>
99101
{getTranslation(ui, "labels", "forgotPassword")}

packages/react/src/auth/forms/sign-up-auth-form.test.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,19 +385,12 @@ describe("<SignUpAuthForm />", () => {
385385
</FirebaseUIProvider>
386386
);
387387

388-
// There should be only one form
389388
const form = container.querySelectorAll("form.fui-form");
390389
expect(form.length).toBe(1);
391390

392-
// Make sure we have email and password inputs but not displayName
393-
expect(screen.getByRole("textbox", { name: /emailAddress/ })).toBeInTheDocument();
391+
expect(screen.getByRole("textbox", { name: /email/ })).toBeInTheDocument();
394392
expect(screen.getByRole("textbox", { name: /password/ })).toBeInTheDocument();
395393
expect(screen.queryByRole("textbox", { name: /displayName/ })).not.toBeInTheDocument();
396-
397-
// Ensure the "Create Account" button is present and is a submit button
398-
const createAccountButton = screen.getByRole("button", { name: "createAccount" });
399-
expect(createAccountButton).toBeInTheDocument();
400-
expect(createAccountButton).toHaveAttribute("type", "submit");
401394
});
402395

403396
it("should trigger displayName validation errors when the form is blurred and requireDisplayName is enabled", () => {
@@ -427,6 +420,7 @@ describe("<SignUpAuthForm />", () => {
427420
expect(form).toBeInTheDocument();
428421

429422
const displayNameInput = screen.getByRole("textbox", { name: /displayName/ });
423+
expect(displayNameInput).toBeInTheDocument();
430424

431425
act(() => {
432426
fireEvent.blur(displayNameInput);

packages/react/src/auth/forms/sign-up-auth-form.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ export function SignUpAuthForm({ onBackToSignInClick, onSignUp }: SignUpAuthForm
9696
>
9797
<form.AppForm>
9898
<fieldset>
99-
<form.AppField name="email">{(field) => <field.Input label="Email" type="email" />}</form.AppField>
99+
<form.AppField name="email">
100+
{(field) => <field.Input label={getTranslation(ui, "labels", "emailAddress")} type="email" />}
101+
</form.AppField>
100102
</fieldset>
101103
<fieldset>
102-
<form.AppField name="password">{(field) => <field.Input label="Password" type="password" />}</form.AppField>
104+
<form.AppField name="password">
105+
{(field) => <field.Input label={getTranslation(ui, "labels", "password")} type="password" />}
106+
</form.AppField>
103107
</fieldset>
104108
{requireDisplayName ? (
105109
<fieldset>

0 commit comments

Comments
 (0)