Skip to content

Commit 824ca23

Browse files
committed
fix(angular): Update tests with latest changes
1 parent 510bde7 commit 824ca23

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/angular/src/lib/auth/forms/mfa/sms-multi-factor-enrollment-form.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe("<fui-sms-multi-factor-enrollment-form />", () => {
153153
});
154154

155155
it("should render phone number form initially", async () => {
156-
await render(SmsMultiFactorEnrollmentFormComponent, {
156+
const { container } = await render(SmsMultiFactorEnrollmentFormComponent, {
157157
imports: [
158158
CommonModule,
159159
SmsMultiFactorEnrollmentFormComponent,
@@ -167,7 +167,7 @@ describe("<fui-sms-multi-factor-enrollment-form />", () => {
167167
});
168168

169169
expect(screen.getByLabelText("Display Name")).toBeInTheDocument();
170-
expect(screen.getByLabelText("Phone Number")).toBeInTheDocument();
170+
expect(container.querySelector('input[name="phoneNumber"]')).toBeInTheDocument();
171171
expect(screen.getByRole("button", { name: "Send Verification Code" })).toBeInTheDocument();
172172
});
173173

packages/angular/src/lib/auth/forms/multi-factor-auth-enrollment-form.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe("<fui-multi-factor-auth-enrollment-form />", () => {
6666
});
6767

6868
it("should auto-select single hint when only one is provided", async () => {
69-
await render(MultiFactorAuthEnrollmentFormComponent, {
69+
const { container } = await render(MultiFactorAuthEnrollmentFormComponent, {
7070
imports: [
7171
CommonModule,
7272
MultiFactorAuthEnrollmentFormComponent,
@@ -83,11 +83,11 @@ describe("<fui-multi-factor-auth-enrollment-form />", () => {
8383
expect(screen.queryByRole("button", { name: "TOTP Verification" })).not.toBeInTheDocument();
8484

8585
expect(screen.getByLabelText("Display Name")).toBeInTheDocument();
86-
expect(screen.getByLabelText("Phone Number")).toBeInTheDocument();
86+
expect(container.querySelector('input[name="phoneNumber"]')).toBeInTheDocument();
8787
});
8888

8989
it("should show SMS form when SMS hint is selected", async () => {
90-
const { fixture } = await render(MultiFactorAuthEnrollmentFormComponent, {
90+
const { fixture, container } = await render(MultiFactorAuthEnrollmentFormComponent, {
9191
imports: [
9292
CommonModule,
9393
MultiFactorAuthEnrollmentFormComponent,
@@ -105,7 +105,7 @@ describe("<fui-multi-factor-auth-enrollment-form />", () => {
105105
fixture.detectChanges();
106106

107107
expect(screen.getByLabelText("Display Name")).toBeInTheDocument();
108-
expect(screen.getByLabelText("Phone Number")).toBeInTheDocument();
108+
expect(container.querySelector('input[name="phoneNumber"]')).toBeInTheDocument();
109109
expect(screen.getByRole("button", { name: "Send Verification Code" })).toBeInTheDocument();
110110
});
111111

packages/angular/src/lib/auth/forms/phone-auth-form.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe("<fui-phone-auth-form />", () => {
9191
});
9292

9393
it("should render phone number form initially", async () => {
94-
await render(PhoneAuthFormComponent, {
94+
const { container } = await render(PhoneAuthFormComponent, {
9595
imports: [
9696
CommonModule,
9797
PhoneAuthFormComponent,
@@ -104,7 +104,7 @@ describe("<fui-phone-auth-form />", () => {
104104
],
105105
});
106106

107-
expect(screen.getByLabelText("Phone Number")).toBeInTheDocument();
107+
expect(container.querySelector('input[name="phoneNumber"]')).toBeInTheDocument();
108108
expect(screen.getByRole("button", { name: "Send Verification Code" })).toBeInTheDocument();
109109
});
110110

@@ -301,7 +301,7 @@ describe("<fui-phone-auth-form />", () => {
301301
});
302302

303303
it("should reset form when going back to phone number step", async () => {
304-
const { fixture } = await render(PhoneAuthFormComponent, {
304+
const { fixture, container } = await render(PhoneAuthFormComponent, {
305305
imports: [
306306
CommonModule,
307307
PhoneAuthFormComponent,
@@ -321,7 +321,7 @@ describe("<fui-phone-auth-form />", () => {
321321
component.verificationId.set(null);
322322
fixture.detectChanges();
323323

324-
expect(screen.getByLabelText("Phone Number")).toBeInTheDocument();
324+
expect(container.querySelector('input[name="phoneNumber"]')).toBeInTheDocument();
325325
expect(screen.queryByLabelText("Verification Code")).toBeNull();
326326
});
327327
});

packages/angular/src/lib/auth/oauth/github-sign-in-button.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("<fui-github-sign-in-button>", () => {
4343
injectTranslation.mockImplementation((category: string, key: string) => {
4444
const mockTranslations: Record<string, Record<string, string>> = {
4545
labels: {
46-
signInWithGithub: "Sign in with GitHub",
46+
signInWithGitHub: "Sign in with GitHub",
4747
},
4848
};
4949
return () => mockTranslations[category]?.[key] || `${category}.${key}`;

0 commit comments

Comments
 (0)