Skip to content

Commit bccf478

Browse files
committed
Merge remote-tracking branch 'origin/feat/react-testing' into test/react-integration-tests
2 parents 51ef906 + 8518adb commit bccf478

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

packages/firebaseui-react/tests/__mocks__/@firebase-ui/core.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ export const fuiSendPasswordResetEmail = coreMocks.fuiSendPasswordResetEmail;
3434
export const fuiCreateUserWithEmailAndPassword =
3535
coreMocks.fuiCreateUserWithEmailAndPassword;
3636
export const getTranslation = coreMocks.getTranslation;
37-
export const populateTranslation = coreMocks.populateTranslation;

packages/firebaseui-react/tests/unit/auth/forms/email-password-form.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ describe("EmailPasswordForm", () => {
183183
password: "password123",
184184
},
185185
})
186-
.catch(() => {
187-
// Catch the error here to prevent test from failing
188-
});
189186
}
190187
});
191188

packages/firebaseui-react/tests/unit/components/country-selector.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ describe("CountrySelector Component", () => {
5959
// Check if onChange was called with the new country
6060
expect(mockOnChange).toHaveBeenCalledTimes(1);
6161
expect(mockOnChange).toHaveBeenCalledWith(newCountry);
62+
} else {
63+
// Fail the test if no different country is found
64+
expect.fail(
65+
"No different country found in countryData. Test cannot proceed."
66+
);
6267
}
6368
});
6469

@@ -81,6 +86,9 @@ describe("CountrySelector Component", () => {
8186
expect(usOption?.textContent).toBe(
8287
`${usCountry.dialCode} (${usCountry.name})`
8388
);
89+
} else {
90+
// Fail the test if US country is not found
91+
expect.fail("US country not found in countryData. Test cannot proceed.");
8492
}
8593
});
8694
});

packages/firebaseui-react/tests/utils/mocks.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ export const createCoreMocks = () => {
7070
fuiCreateUserWithEmailAndPassword: vi.fn(),
7171
getTranslation: createMockTranslations(),
7272
countryData: mockCountryData,
73-
populateTranslation: vi.fn((text, data) => {
74-
if (!data) return text;
75-
let result = text;
76-
Object.entries(data).forEach(([key, value]) => {
77-
result = result.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), value);
78-
});
79-
return result;
80-
}),
8173
FirebaseUIError,
8274
};
8375
};

pnpm-workspace.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
packages:
2-
- 'packages/*'
3-
- 'packages/angular/projects/*'
4-
- 'examples/*'
2+
- packages/*
3+
- packages/angular/projects/*
4+
- examples/*
5+
onlyBuiltDependencies:
6+
- '@parcel/watcher'
7+
- esbuild
8+
- lmdb
9+
- msgpackr-extract
10+
- protobufjs
11+
- sharp

0 commit comments

Comments
 (0)