Skip to content

Commit

Permalink
fix(repo): Adjust a couple of things
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed May 16, 2024
1 parent 3072192 commit 4ddd59a
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 115 deletions.
3 changes: 2 additions & 1 deletion integration/templates/elements-next/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ body {
body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell,
Ubuntu, roboto, noto, arial, sans-serif;
}

main {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export default function SignInPage() {
/>
<Clerk.FieldError className='mt-2 block text-xs text-red-600' />
</Clerk.Field>
<Clerk.Field
name='password'
className='opacity-0 h-0 pointer-events-none absolute'
>
<Clerk.Input />
</Clerk.Field>
<SignIn.Action
submit
asChild
Expand Down Expand Up @@ -212,6 +218,7 @@ export default function SignInPage() {
type='otp'
required
placeholder='Email code'
autoSubmit
aria-label='Enter email verification code'
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'
/>
Expand Down Expand Up @@ -256,6 +263,7 @@ export default function SignInPage() {
type='otp'
required
placeholder='Email code'
autoSubmit
aria-label='Enter email verification code'
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'
/>
Expand All @@ -279,6 +287,7 @@ export default function SignInPage() {
type='otp'
required
placeholder='Phone code'
autoSubmit
aria-label='Enter phone verification code'
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'
/>
Expand Down
4 changes: 2 additions & 2 deletions integration/testUtils/signInPageObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export const createSignInComponentPageObject = (testArgs: TestArgs) => {
const self = {
...common(testArgs),
goTo: async (opts?: { searchParams?: URLSearchParams; headlessSelector?: string }) => {
await page.goToRelative('/sign-in', { searchParams: opts.searchParams });
await page.goToRelative('/sign-in', { searchParams: opts?.searchParams });

if (typeof opts.headlessSelector !== 'undefined') {
if (typeof opts?.headlessSelector !== 'undefined') {
return self.waitForMounted(opts.headlessSelector);
} else {
return self.waitForMounted();
Expand Down
4 changes: 2 additions & 2 deletions integration/testUtils/signUpPageObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const createSignUpComponentPageObject = (testArgs: TestArgs) => {
const self = {
...common(testArgs),
goTo: async (opts?: { searchParams?: URLSearchParams; headlessSelector?: string }) => {
await page.goToRelative('/sign-up', { searchParams: opts.searchParams });
await page.goToRelative('/sign-up', { searchParams: opts?.searchParams });

if (typeof opts.headlessSelector !== 'undefined') {
if (typeof opts?.headlessSelector !== 'undefined') {
return self.waitForMounted(opts.headlessSelector);
} else {
return self.waitForMounted();
Expand Down
8 changes: 2 additions & 6 deletions integration/tests/elements/next-sign-in.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
await u.po.expect.toBeSignedIn();
});

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

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

await u.po.signIn.setIdentifier(fakeUser.email);
await u.po.signIn.continue();
// TODO: In AIO this is a link with an href

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');
Expand All @@ -73,7 +73,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S
const u = createTestUtils({ app, page, context });
await u.po.signIn.goTo({ headlessSelector: '[data-test-id="sign-in-step-start"]' });

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

await u.po.signIn.getIdentifierInput().fill(fakeUserWithPasword.email);
await u.po.signIn.continue();
// TODO: In AIO this is a link with an empty href
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');
Expand Down Expand Up @@ -169,7 +166,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S

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

// TODO: In AIO this is a link with an href
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');
Expand Down
7 changes: 0 additions & 7 deletions integration/tests/elements/next-sign-up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S

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

/*
await u.po.signIn.signInWithEmailAndInstantPassword({
email: fakeUser.email,
password: fakeUser.password,
});
*/

await u.po.signIn.setIdentifier(fakeUser.email);
await u.po.signIn.continue();
await u.po.signIn.setPassword(fakeUser.password);
Expand Down
96 changes: 0 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/elements/src/react/sign-in/verifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '~/react/sign-in/context';
import { createContextFromActorRef } from '~/react/utils/create-context-from-actor-ref';

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

export const SignInFirstFactorCtx = createContextFromActorRef<TSignInFirstFactorMachine>('SignInFirstFactorCtx');
export const SignInSecondFactorCtx = createContextFromActorRef<TSignInSecondFactorMachine>('SignInSecondFactorCtx');
Expand Down
6 changes: 6 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
"inputs": ["integration/**"],
"outputMode": "new-only"
},
"//#test:integration:elements": {
"dependsOn": ["^@clerk/nextjs#build", "^@clerk/elements#build"],
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
"inputs": ["integration/**"],
"outputMode": "new-only"
}
}
}

0 comments on commit 4ddd59a

Please sign in to comment.