Skip to content

Commit 04fcfdc

Browse files
authored
Merge pull request #1188 from firebase/@invertase/align-react-tests
2 parents ac08d1d + 5a80a9f commit 04fcfdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3711
-2597
lines changed

packages/core/src/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export async function signInAnonymously(ui: FirebaseUIConfiguration): Promise<Us
213213
}
214214
}
215215

216-
export async function signInWithOAuth(ui: FirebaseUIConfiguration, provider: AuthProvider): Promise<void> {
216+
export async function signInWithProvider(ui: FirebaseUIConfiguration, provider: AuthProvider): Promise<void> {
217217
try {
218218
if (hasBehavior(ui, "autoUpgradeAnonymousProvider")) {
219219
await getBehavior(ui, "autoUpgradeAnonymousProvider")(ui, provider);
@@ -222,6 +222,8 @@ export async function signInWithOAuth(ui: FirebaseUIConfiguration, provider: Aut
222222
}
223223

224224
ui.setState("pending");
225+
226+
// TODO(ehesp): Handle popup or redirect based on behavior
225227
await signInWithRedirect(ui.auth, provider);
226228
// We don't modify state here since the user is redirected.
227229
// If we support popups, we'd need to modify state here.

packages/core/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { deepMap, DeepMapStore, map } from "nanostores";
2121
import { Behavior, type BehaviorHandlers, type BehaviorKey, getBehavior, hasBehavior } from "./behaviors";
2222
import { FirebaseUIState } from "./state";
2323

24-
type FirebaseUIConfigurationOptions = {
24+
export type FirebaseUIConfigurationOptions = {
2525
app: FirebaseApp;
2626
auth?: Auth;
2727
locale?: RegisteredLocale;

packages/core/tests/unit/auth.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
sendSignInLinkToEmail,
4242
signInWithEmailLink,
4343
signInAnonymously,
44-
signInWithOAuth,
44+
signInWithProvider,
4545
completeEmailLinkSignIn,
4646
} from "../../src/auth";
4747
import { FirebaseUIConfiguration } from "../../src/config";
@@ -302,11 +302,11 @@ describe("Firebase UI Auth", () => {
302302
});
303303
});
304304

305-
describe("signInWithOAuth", () => {
305+
describe("signInWithProvider", () => {
306306
it("should sign in with OAuth provider", async () => {
307307
(signInWithRedirect as any).mockResolvedValue(undefined);
308308

309-
await signInWithOAuth(mockUi, mockProvider as any);
309+
await signInWithProvider(mockUi, mockProvider as any);
310310

311311
expect(signInWithRedirect).toHaveBeenCalledWith(mockAuth, mockProvider);
312312
});
@@ -318,7 +318,7 @@ describe("Firebase UI Auth", () => {
318318

319319
mockUi.behaviors.autoUpgradeAnonymousProvider = vi.fn();
320320

321-
await signInWithOAuth(mockUi, mockProvider as any);
321+
await signInWithProvider(mockUi, mockProvider as any);
322322

323323
expect(mockUi.behaviors.autoUpgradeAnonymousProvider).toHaveBeenCalledWith(mockUi, mockProvider);
324324
});

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@firebase-ui/styles": "workspace:*",
4444
"@nanostores/react": "^0.8.4",
4545
"@radix-ui/react-slot": "^1.2.3",
46-
"@tanstack/react-form": "^0.41.3",
46+
"@tanstack/react-form": "^1.20.0",
4747
"clsx": "^2.1.1",
4848
"tailwind-merge": "^3.0.1",
4949
"zod": "catalog:"

packages/react/setup-test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { expect } from "vitest";
18-
import * as matchers from "@testing-library/jest-dom/matchers";
19-
20-
// Extend Vitest's expect with jest-dom matchers
21-
expect.extend(matchers);
17+
import '@testing-library/jest-dom/vitest';

0 commit comments

Comments
 (0)