Skip to content

Commit 4ddd59a

Browse files
committed
fix(repo): Adjust a couple of things
1 parent 3072192 commit 4ddd59a

File tree

9 files changed

+24
-115
lines changed

9 files changed

+24
-115
lines changed

integration/templates/elements-next/src/app/globals.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ body {
2323
body {
2424
color: rgb(var(--foreground-rgb));
2525
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
26-
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
26+
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell,
27+
Ubuntu, roboto, noto, arial, sans-serif;
2728
}
2829

2930
main {

integration/templates/elements-next/src/app/sign-in/[[...sign-in]]/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ export default function SignInPage() {
5757
/>
5858
<Clerk.FieldError className='mt-2 block text-xs text-red-600' />
5959
</Clerk.Field>
60+
<Clerk.Field
61+
name='password'
62+
className='opacity-0 h-0 pointer-events-none absolute'
63+
>
64+
<Clerk.Input />
65+
</Clerk.Field>
6066
<SignIn.Action
6167
submit
6268
asChild
@@ -212,6 +218,7 @@ export default function SignInPage() {
212218
type='otp'
213219
required
214220
placeholder='Email code'
221+
autoSubmit
215222
aria-label='Enter email verification code'
216223
className='w-full border-b border-neutral-200 bg-white pb-2 text-sm/6 text-neutral-950 outline-none placeholder:text-neutral-400 hover:border-neutral-300 focus:border-neutral-600 data-[invalid]:border-red-600 data-[invalid]:text-red-600'
217224
/>
@@ -256,6 +263,7 @@ export default function SignInPage() {
256263
type='otp'
257264
required
258265
placeholder='Email code'
266+
autoSubmit
259267
aria-label='Enter email verification code'
260268
className='w-full border-b border-neutral-200 bg-white pb-2 text-sm/6 text-neutral-950 outline-none placeholder:text-neutral-400 hover:border-neutral-300 focus:border-neutral-600 data-[invalid]:border-red-600 data-[invalid]:text-red-600'
261269
/>
@@ -279,6 +287,7 @@ export default function SignInPage() {
279287
type='otp'
280288
required
281289
placeholder='Phone code'
290+
autoSubmit
282291
aria-label='Enter phone verification code'
283292
className='w-full border-b border-neutral-200 bg-white pb-2 text-sm/6 text-neutral-950 outline-none placeholder:text-neutral-400 hover:border-neutral-300 focus:border-neutral-600 data-[invalid]:border-red-600 data-[invalid]:text-red-600'
284293
/>

integration/testUtils/signInPageObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const createSignInComponentPageObject = (testArgs: TestArgs) => {
1212
const self = {
1313
...common(testArgs),
1414
goTo: async (opts?: { searchParams?: URLSearchParams; headlessSelector?: string }) => {
15-
await page.goToRelative('/sign-in', { searchParams: opts.searchParams });
15+
await page.goToRelative('/sign-in', { searchParams: opts?.searchParams });
1616

17-
if (typeof opts.headlessSelector !== 'undefined') {
17+
if (typeof opts?.headlessSelector !== 'undefined') {
1818
return self.waitForMounted(opts.headlessSelector);
1919
} else {
2020
return self.waitForMounted();

integration/testUtils/signUpPageObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const createSignUpComponentPageObject = (testArgs: TestArgs) => {
1616
const self = {
1717
...common(testArgs),
1818
goTo: async (opts?: { searchParams?: URLSearchParams; headlessSelector?: string }) => {
19-
await page.goToRelative('/sign-up', { searchParams: opts.searchParams });
19+
await page.goToRelative('/sign-up', { searchParams: opts?.searchParams });
2020

21-
if (typeof opts.headlessSelector !== 'undefined') {
21+
if (typeof opts?.headlessSelector !== 'undefined') {
2222
return self.waitForMounted(opts.headlessSelector);
2323
} else {
2424
return self.waitForMounted();

integration/tests/elements/next-sign-in.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
4242
await u.po.expect.toBeSignedIn();
4343
});
4444

45-
test.fixme('sign in with email and instant password', async ({ page, context }) => {
45+
test('sign in with email and instant password', async ({ page, context }) => {
4646
const u = createTestUtils({ app, page, context });
4747
await u.po.signIn.goTo({ headlessSelector: '[data-test-id="sign-in-step-start"]' });
4848

@@ -57,7 +57,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
5757

5858
await u.po.signIn.setIdentifier(fakeUser.email);
5959
await u.po.signIn.continue();
60-
// TODO: In AIO this is a link with an href
60+
6161
await u.page.getByRole('button', { name: /use another method/i }).click();
6262
await u.po.signIn.getAltMethodsEmailCodeButton().click();
6363
await u.po.signIn.fillTestOtpCode('Enter email verification code');
@@ -73,7 +73,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
7373
const u = createTestUtils({ app, page, context });
7474
await u.po.signIn.goTo({ headlessSelector: '[data-test-id="sign-in-step-start"]' });
7575

76-
// TODO: In AIO this is a link with an empty href
7776
await u.page.getByRole('button', { name: /^use phone/i }).click();
7877
await u.po.signIn.getIdentifierInput().fill(fakeUser.phoneNumber);
7978
await u.po.signIn.continue();
@@ -92,7 +91,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
9291
});
9392
await u.services.users.createBapiUser(fakeUserWithoutPassword);
9493
await u.po.signIn.goTo({ headlessSelector: '[data-test-id="sign-in-step-start"]' });
95-
// TODO: In AIO this is a link with an empty href
9694
await u.page.getByRole('button', { name: /^use phone/i }).click();
9795
await u.po.signIn.getIdentifierInput().fill(fakeUserWithoutPassword.phoneNumber);
9896
await u.po.signIn.continue();
@@ -129,7 +127,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
129127

130128
await u.po.signIn.getIdentifierInput().fill(fakeUserWithPasword.email);
131129
await u.po.signIn.continue();
132-
// TODO: In AIO this is a link with an empty href
133130
await u.page.getByRole('button', { name: /^forgot password/i }).click();
134131
await u.po.signIn.getResetPassword().click();
135132
await u.po.signIn.fillTestOtpCode('Enter email verification code');
@@ -169,7 +166,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
169166

170167
await expect(u.page.getByText(/^password is incorrect/i)).toBeVisible();
171168

172-
// TODO: In AIO this is a link with an href
173169
await u.page.getByRole('button', { name: /use another method/i }).click();
174170
await u.po.signIn.getAltMethodsEmailCodeButton().click();
175171
await u.po.signIn.fillTestOtpCode('Enter email verification code');

integration/tests/elements/next-sign-up.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
156156

157157
await u.po.signIn.goTo({ headlessSelector: '[data-test-id="sign-in-step-start"]' });
158158

159-
/*
160-
await u.po.signIn.signInWithEmailAndInstantPassword({
161-
email: fakeUser.email,
162-
password: fakeUser.password,
163-
});
164-
*/
165-
166159
await u.po.signIn.setIdentifier(fakeUser.email);
167160
await u.po.signIn.continue();
168161
await u.po.signIn.setPassword(fakeUser.password);

package-lock.json

Lines changed: 0 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/elements/src/react/sign-in/verifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '~/react/sign-in/context';
1919
import { createContextFromActorRef } from '~/react/utils/create-context-from-actor-ref';
2020

21-
export type SignInVerificationsProps = { preferred?: ClerkSignInStrategy; children: React.ReactNode } & FormProps;
21+
export type SignInVerificationsProps = { preferred?: ClerkSignInStrategy } & FormProps;
2222

2323
export const SignInFirstFactorCtx = createContextFromActorRef<TSignInFirstFactorMachine>('SignInFirstFactorCtx');
2424
export const SignInSecondFactorCtx = createContextFromActorRef<TSignInSecondFactorMachine>('SignInSecondFactorCtx');

turbo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@
159159
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
160160
"inputs": ["integration/**"],
161161
"outputMode": "new-only"
162+
},
163+
"//#test:integration:elements": {
164+
"dependsOn": ["^@clerk/nextjs#build", "^@clerk/elements#build"],
165+
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
166+
"inputs": ["integration/**"],
167+
"outputMode": "new-only"
162168
}
163169
}
164170
}

0 commit comments

Comments
 (0)