-
Notifications
You must be signed in to change notification settings - Fork 380
feat(clerk-js): Update OTP to use a single transparent field #6551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
93f2738
ff4790f
55b55b4
597638d
d76658d
44895b0
b7b6ffd
9ff5721
4147922
29089a9
817595d
5504351
0beb254
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@clerk/clerk-js': minor | ||
--- | ||
|
||
Rework the OTP input to use a single transparent input (via `input-otp`) to improve password manager compatibility and iOS/Android SMS-based autofill. Removes individual digit fields; a single invisible input drives the six visual slots. | ||
|
||
If you're using `@clerk/testing`, please ensure that you're using the latest version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@clerk/testing': minor | ||
--- | ||
|
||
Update `enterOtpCode` to support new OTP input. Please ensure you're testing against the latest versions of each @clerk package. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,11 @@ export const common: PlaywrightTestConfig = { | |
fullyParallel: true, | ||
forbidOnly: !!process.env.CI, | ||
retries: process.env.CI ? 5 : 0, | ||
timeout: 90_000, | ||
maxFailures: process.env.CI ? 5 : undefined, | ||
workers: process.env.CI ? '50%' : '70%', | ||
use: { | ||
actionTimeout: 10_000, | ||
navigationTimeout: 30_000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Relatively safe generic timeouts. More-specific ones are assigned (at the existing 90s) in various |
||
ignoreHTTPSErrors: true, | ||
trace: 'retain-on-failure', | ||
bypassCSP: true, // We probably need to limit this to specific tests | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,10 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('component | |
await u.page.goToRelative(component.path, { waitUntil: 'commit' }); | ||
await expect(u.page.getByText(component.fallback)).toBeVisible(); | ||
|
||
await signOut({ app, page, context }); | ||
// eslint-disable-next-line playwright/no-conditional-in-test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to run if it's never signed in, per a similar if statement. |
||
if (component.protected) { | ||
await signOut({ app, page, context }); | ||
} | ||
}); | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,9 +75,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | |
|
||
await u.page.getByRole('button', { name: /use another method/i }).click(); | ||
await u.po.signIn.getAltMethodsEmailCodeButton().click(); | ||
await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
await page.waitForTimeout(2000); | ||
// TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
await page.keyboard.type('424242', { delay: 100 }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These particular actions don't apply to our generic OTP component and, as such, are handled differently... and aren't common thus shouldn't go in |
||
await u.po.signIn.continue(); | ||
|
||
await u.page.waitForAppUrl('/'); | ||
|
@@ -110,8 +109,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | |
await u.page.getByRole('button', { name: /^use phone/i }).click(); | ||
await u.po.signIn.getIdentifierInput().fill(fakeUserWithoutPassword.phoneNumber); | ||
await u.po.signIn.continue(); | ||
await u.po.signIn.fillTestOtpCode('Enter phone verification code'); | ||
await page.waitForTimeout(2000); | ||
await page.getByRole('textbox', { name: 'Enter phone verification code' }).click(); | ||
await page.keyboard.type('424242', { delay: 100 }); | ||
await u.po.signIn.continue(); | ||
|
||
await u.po.expect.toBeSignedIn(); | ||
|
@@ -146,9 +145,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | |
await u.po.signIn.continue(); | ||
await u.page.getByRole('button', { name: /^forgot password/i }).click(); | ||
await u.po.signIn.getResetPassword().click(); | ||
await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
await page.waitForTimeout(2000); | ||
// TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
await page.keyboard.type('424242', { delay: 100 }); | ||
await u.po.signIn.continue(); | ||
|
||
await u.po.signIn.setPassword(`${fakeUserWithPasword.password}_reset`); | ||
|
@@ -187,9 +185,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | |
|
||
await u.page.getByRole('button', { name: /use another method/i }).click(); | ||
await u.po.signIn.getAltMethodsEmailCodeButton().click(); | ||
await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
await page.waitForTimeout(2000); | ||
// TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
await page.keyboard.type('424242', { delay: 100 }); | ||
await u.po.signIn.continue(); | ||
|
||
await u.po.expect.toBeSignedIn(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.