Skip to content

Commit bc73322

Browse files
authored
chore(e2e,astro): Add a test case for updateClerkOptions (clerk#3706)
1 parent 83eefc6 commit bc73322

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

.changeset/soft-waves-reflect.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

integration/tests/astro/components.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,20 @@ testAgainstRunningApps({ withPattern: ['astro.node.withCustomRoles'] })('basic f
9696
await expect(u.page.getByText('Go to this page to see your profile')).toBeVisible();
9797
await expect(u.page.getByText('Sign out!')).toBeVisible();
9898
});
99+
100+
test('test updateClerkOptions by changing localization on the fly', async ({ page, context }) => {
101+
const u = createTestUtils({ app, page, context });
102+
await u.po.signIn.goTo();
103+
await u.po.signIn.waitForMounted();
104+
const selectElement = await u.page.$('select');
105+
const selectedOption = await selectElement.evaluate(el => (el as any).options[(el as any).selectedIndex].text);
106+
if (selectedOption !== 'English') {
107+
throw new Error('English option is not selected by default');
108+
}
109+
110+
await expect(u.page.getByText('Welcome back! Please sign in to continue')).toBeVisible();
111+
await selectElement.selectOption({ label: 'French' });
112+
113+
await expect(u.page.getByText('pour continuer vers')).toBeVisible();
114+
});
99115
});

0 commit comments

Comments
 (0)