Skip to content

Commit

Permalink
Merge branch 'main' into elef/next-13-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed May 29, 2024
2 parents adb29c4 + 68f2474 commit a9ec71d
Show file tree
Hide file tree
Showing 119 changed files with 8,402 additions and 930 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-chicken-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Support remounting ClerkProvider multiple times by making sure that the `updateProps` call during the loading phase does not override any defaults set by `Clerk.load()` for values that are missing
5 changes: 5 additions & 0 deletions .changeset/shy-phones-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/localizations": patch
---

Updates on ko-KR localization
5 changes: 5 additions & 0 deletions .changeset/unlucky-buckets-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/localizations": patch
---

Add passkeys localizations for the `es-MX` locale
File renamed without changes.
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Root = () => {
<ClerkProvider
// @ts-ignore
publishableKey={import.meta.env.VITE_CLERK_PUBLISHABLE_KEY as string}
clerkJSUrl={import.meta.env.VITE_CLERK_JS as string}
clerkJSUrl={import.meta.env.VITE_CLERK_JS_URL as string}
routerPush={(to: string) => navigate(to)}
routerReplace={(to: string) => navigate(to, { replace: true })}
>
Expand Down
2 changes: 1 addition & 1 deletion integration/tests/sign-up-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign up f
});

// Check if password error is visible
await expect(u.page.getByText(/your password must contain \d+ or more characters/i)).toBeVisible();
await expect(u.page.getByText(/your password must contain \d+ or more characters/i).first()).toBeVisible();

// Check if user is signed out
await u.po.expect.toBeSignedOut();
Expand Down
45 changes: 45 additions & 0 deletions integration/tests/update-props.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { test } from '@playwright/test';

import type { FakeUser } from '../testUtils';
import { createTestUtils, testAgainstRunningApps } from '../testUtils';

testAgainstRunningApps({ withPattern: ['react.vite.withEmailCodes'] })('sign in flow @generic', ({ app }) => {
test.describe.configure({ mode: 'serial' });

let fakeUser: FakeUser;

test.beforeAll(async () => {
const u = createTestUtils({ app });
fakeUser = u.services.users.createFakeUser({
fictionalEmail: true,
withPassword: true,
});
await u.services.users.createBapiUser(fakeUser);
});

test.afterAll(async () => {
await fakeUser.deleteIfExists();
await app.teardown();
});

test('updating props after initial loading does not override defaults set by Clerk.load()', async ({
page,
context,
}) => {
const u = createTestUtils({ app, page, context });
await u.po.signIn.goTo({ searchParams: new URLSearchParams({ redirect_url: 'https://www.clerk.com' }) });
await u.page.waitForFunction(async () => {
// Emulate ClerkProvider being unmounted and mounted again
// as updateProps is going to be called without the default options set by window.Clerk.load()
await (window.Clerk as any).__unstable__updateProps({ options: {} });
});
await u.po.signIn.setIdentifier(fakeUser.email);
await u.po.signIn.continue();
await u.po.signIn.setPassword(fakeUser.password);
await u.po.signIn.continue();
await u.po.expect.toBeSignedIn();
// allowedRedirectOrigins should still be respected here
// even after the above updateProps invocation
await u.page.waitForURL(`${app.serverUrl}`);
});
});
Loading

0 comments on commit a9ec71d

Please sign in to comment.