Skip to content

Commit 9b56b36

Browse files
committed
chore(e2e): drop mailsac and improve error logging in test utilities
Removed Mailsac API integration from emailService as it's no longer needed for integration tests. Tests now use fictional emails with +clerk_test suffix that can be verified using the 424242 OTP without sending actual emails. Added withErrorLogging wrapper function to usersService that logs detailed error information (status, message, errors, clerkTraceId) for all Clerk API calls. This improves debugging when tests fail by providing immediate visibility into API errors without requiring log aggregation. Wrapped all clerkClient calls in usersService with withErrorLogging including: - User operations: createUser, getUser, getUserList, deleteUser - Organization operations: createOrganization, deleteOrganization - API key operations: create, revoke
1 parent a19e151 commit 9b56b36

File tree

17 files changed

+160
-39
lines changed

17 files changed

+160
-39
lines changed

integration/templates/astro-hybrid/astro.config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ import react from '@astrojs/react';
44

55
export default defineConfig({
66
output: 'hybrid',
7-
integrations: [clerk(), react()],
7+
integrations: [
8+
clerk({
9+
appearance: {
10+
options: {
11+
showOptionalFields: true,
12+
},
13+
},
14+
}),
15+
react(),
16+
],
817
server: {
918
port: Number(process.env.PORT),
1019
},

integration/templates/astro-node/astro.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ export default defineConfig({
1010
adapter: node({
1111
mode: 'standalone',
1212
}),
13-
integrations: [clerk(), react(), tailwind()],
13+
integrations: [
14+
clerk({
15+
appearance: {
16+
options: {
17+
showOptionalFields: true,
18+
},
19+
},
20+
}),
21+
react(),
22+
tailwind(),
23+
],
1424
server: {
1525
port: Number(process.env.PORT),
1626
},

integration/templates/custom-flows-react-vite/src/main.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ createRoot(document.getElementById('root')!).render(
2323
publishableKey={PUBLISHABLE_KEY}
2424
clerkJSUrl={import.meta.env.VITE_CLERK_JS_URL as string}
2525
clerkUiUrl={import.meta.env.VITE_CLERK_UI_URL as string}
26+
appearance={{
27+
options: {
28+
showOptionalFields: true,
29+
},
30+
}}
2631
>
2732
<BrowserRouter>
2833
<Routes>

integration/templates/expo-web/app/_layout.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export default function RootLayout() {
1010
routerReplace={to => router.replace(to)}
1111
clerkJSUrl={process.env.EXPO_PUBLIC_CLERK_JS_URL}
1212
clerkUiUrl={process.env.EXPO_PUBLIC_CLERK_UI_URL}
13+
appearance={{
14+
options: {
15+
showOptionalFields: true,
16+
},
17+
}}
1318
>
1419
<ClerkLoaded>
1520
<Stack>

integration/templates/next-app-router-quickstart/src/app/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ export const metadata = {
1111

1212
export default function RootLayout({ children }: { children: React.ReactNode }) {
1313
return (
14-
<ClerkProvider>
14+
<ClerkProvider
15+
appearance={{
16+
options: {
17+
showOptionalFields: true,
18+
},
19+
}}
20+
>
1521
<html lang='en'>
1622
<body className={inter.className}>{children}</body>
1723
</html>

integration/templates/next-app-router/src/app/jwt-v2-organizations/(tests)/has-ssr/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import { SSR } from './client';
33

44
export default function Page() {
55
return (
6-
<ClerkProvider dynamic>
6+
<ClerkProvider
7+
dynamic
8+
appearance={{
9+
options: {
10+
showOptionalFields: true,
11+
},
12+
}}
13+
>
714
<SSR />
815
</ClerkProvider>
916
);

integration/templates/next-app-router/src/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default function RootLayout({ children }: { children: React.ReactNode })
1313
return (
1414
<ClerkProvider
1515
appearance={{
16-
layout: {
16+
options: {
17+
showOptionalFields: true,
1718
// Icon buttons only contain accessible labels when they use an icon; our generated letter icon does not have
1819
// an accessible label. Using the "blockButton" variant ensures that the button contains a visible label that
1920
// can be selected by a Playwright selector.
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import { ClerkProvider } from '@clerk/nextjs';
22

33
export default function Layout({ children }: { children: React.ReactNode }) {
4-
return <ClerkProvider dynamic>{children}</ClerkProvider>;
4+
return (
5+
<ClerkProvider
6+
dynamic
7+
appearance={{
8+
options: {
9+
showOptionalFields: true,
10+
},
11+
}}
12+
>
13+
{children}
14+
</ClerkProvider>
15+
);
516
}

integration/templates/nuxt-node/nuxt.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
export default defineNuxtConfig({
22
modules: ['@clerk/nuxt'],
3+
clerk: {
4+
appearance: {
5+
options: {
6+
showOptionalFields: true,
7+
},
8+
},
9+
},
310
devtools: {
411
enabled: false,
512
},

integration/templates/react-cra/src/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ root.render(
1111
publishableKey={process.env.REACT_APP_CLERK_PUBLISHABLE_KEY as string}
1212
clerkJSUrl={process.env.REACT_APP_CLERK_JS as string}
1313
clerkUiUrl={process.env.REACT_APP_CLERK_UI as string}
14+
appearance={{
15+
options: {
16+
showOptionalFields: true,
17+
},
18+
}}
1419
>
1520
<App />
1621
</ClerkProvider>

0 commit comments

Comments
 (0)