Skip to content

test(electron): Initial Electron SDK integration test#9014

Merged
wobsoriano merged 5 commits into
mainfrom
rob/user-5628-setup-e2e-tests-for-electron-sdk
Jun 26, 2026
Merged

test(electron): Initial Electron SDK integration test#9014
wobsoriano merged 5 commits into
mainfrom
rob/user-5628-setup-e2e-tests-for-electron-sdk

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features
    • Added an Electron + Vite preset and a new Electron-Vite starter template with authentication UI, secure preload bridge, and baseline styling.
    • Wired the Electron preset into the integration preset catalog for quicker scaffolding.
  • Bug Fixes
    • Improved CI reliability for Electron integration tests by running them under a virtual display when needed.
    • Hardened Electron renderer asset loading to safely serve bundled routes.
  • Tests
    • Added Playwright Electron E2E tests for sign-in/sign-out and session persistence, plus fixtures and test:integration:electron/Turbo task support.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 26, 2026 5:01pm
swingset Ready Ready Preview, Comment Jun 26, 2026 5:01pm

Request Review

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f179e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 47e9f48c-db9b-44b2-9e6d-7448cc1a1989

📥 Commits

Reviewing files that changed from the base of the PR and between 6a98c41 and 4f179e2.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • integration/presets/electron.ts
  • integration/templates/electron-vite/main.mjs
  • integration/tests/electron/fixtures.ts
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • integration/presets/electron.ts
  • integration/templates/electron-vite/main.mjs
  • integration/tests/electron/fixtures.ts

📝 Walkthrough

Walkthrough

Adds an Electron Vite integration template, runtime bridge and renderer, Playwright auth fixtures and test, and CI wiring for a new @electron integration target.

Changes

Electron integration template and test flow

Layer / File(s) Summary
Template scaffold and preset wiring
integration/templates/electron-vite/index.html, integration/templates/electron-vite/package.json, integration/templates/electron-vite/tsconfig.json, integration/templates/electron-vite/vite.config.ts, integration/templates/electron-vite/src/style.css, integration/templates/electron-vite/src/vite-env.d.ts, integration/templates/index.ts, integration/presets/electron.ts, integration/presets/index.ts
Adds the electron-vite template scaffold plus template and preset registry entries.
Electron startup and renderer
integration/templates/electron-vite/main.mjs, integration/templates/electron-vite/preload.mjs, integration/templates/electron-vite/src/main.tsx
Adds the Electron host process, preload bridge exposure, and Clerk renderer entry.
Electron fixtures and auth test
integration/tests/electron/*
Adds Playwright Electron fixtures and a basic auth sign-in test.
Integration test CI wiring
.changeset/electron-e2e-tests.md, .github/workflows/ci.yml, package.json, turbo.json
Adds the Electron integration-test script, Turbo task, CI matrix/Xvfb handling, and changeset entry.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • clerk/javascript#8766 — Shares the Turbo integration-test output path wiring used for Playwright report artifacts.
  • clerk/javascript#8786 — Adds the @clerk/electron bridge and preload/runtime plumbing that this template exercises.

Suggested reviewers

  • jeremy-clerk

Poem

I hopped through the Electron glade,
With Xvfb lights and bridges made.
The Clerk bits twinkled, tests went by,
A user id appeared — oh my!
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding an initial Electron SDK integration test.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9014

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9014

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9014

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9014

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9014

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9014

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9014

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9014

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9014

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9014

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9014

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9014

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9014

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9014

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9014

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9014

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9014

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9014

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9014

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9014

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9014

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9014

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9014

commit: 4f179e2

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
integration/templates/electron-vite/main.mjs (1)

25-30: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Prefer keeping the renderer sandbox on.

sandbox: false weakens the BrowserWindow isolation this template is meant to exercise. If @clerk/electron works with the preload bridge under Electron’s default sandbox, flip this back to true; otherwise document the incompatibility inline.

🔒 Suggested adjustment
     webPreferences: {
       contextIsolation: true,
       nodeIntegration: false,
       preload: path.resolve(__dirname, 'preload.mjs'),
-      sandbox: false,
+      sandbox: true,
     },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/templates/electron-vite/main.mjs` around lines 25 - 30, The
BrowserWindow configuration in main.mjs disables the renderer sandbox via
webPreferences.sandbox = false, weakening the isolation this template is meant
to test. Update the BrowserWindow/webPreferences setup to keep sandbox enabled
if `@clerk/electron` still works with the preload bridge under Electron’s default
sandbox; otherwise leave the value as-is but add an inline note in the same
configuration block explaining the incompatibility. Use the BrowserWindow
options and preload.mjs reference to locate the change.
integration/templates/electron-vite/tsconfig.json (1)

19-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Typecheck the root Vite config too.

"include": ["src"] leaves the new vite.config.ts outside TS checking, so config regressions in the template will only surface when Vite executes it. Add that file here or split app/node tsconfigs.

♻️ Proposed change
-  "include": ["src"]
+  "include": ["src", "vite.config.ts"]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/templates/electron-vite/tsconfig.json` at line 19, The Electron
Vite template tsconfig currently only includes src, so the root vite.config.ts
is excluded from TypeScript checking. Update the tsconfig include list used by
the template to cover vite.config.ts as well, or split the app and Node/Vite
configs so the config file is typechecked by the appropriate tsconfig.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration/presets/electron.ts`:
- Around line 9-12: The Electron preset currently wires the package scripts in
`integration/presets/electron.ts` so `dev` only builds and `serve` is a noop,
which leaves no runnable app flow. Update the `addScript('dev', ...)` and
`addScript('serve', ...)` entries to point to the actual Electron development
and startup commands used by the template, keeping `setup` and `build`
unchanged. Use the existing script wiring in the preset as the place to fix this
so generated projects expose a real `dev` path and a real `serve` path.

In `@integration/templates/electron-vite/package.json`:
- Around line 23-25: The electron-vite template still declares a Node engine
floor below the repository baseline. Update the package.json engines.node value
in this template to match the required minimum Node.js version used elsewhere in
the repo (Node.js >=24.15.0), keeping it consistent with the root package.json
and .nvmrc so the template does not advertise unsupported runtimes.

In `@integration/templates/electron-vite/src/main.tsx`:
- Around line 7-8: The startup constants in main.tsx rely on TypeScript
assertions only, so missing VITE_CLERK_PUBLISHABLE_KEY or VITE_CLERK_UI_URL can
still reach Clerk as undefined. Update the initialization around PUBLISHABLE_KEY
and CLERK_UI_URL to validate both env vars immediately at startup and throw a
clear, developer-facing error if either is absent or empty. Keep the check close
to the existing env reads so the failure happens before Clerk setup, and make
the message specific enough to identify which required variable is missing.

In `@integration/tests/electron/fixtures.ts`:
- Around line 34-42: Skip clerkSetup for non-development publishable keys in the
Electron fixture setup so testing-token initialization only runs for development
instances. Update the helper in fixtures.ts to gate the clerkSetup call the same
way application.ts does, using the parsed instance type or an equivalent check
before calling clerkSetup. Keep the publishableKey/parsePublishableKey flow
intact, and only proceed with the testing-token setup path when the key is for
development.
- Around line 22-23: setupClerkTestingEnv() currently always invokes
clerkSetup(), but the app only uses that path for development publishable keys,
so Electron fixtures can break with staging/non-development keys. Update
setupClerkTestingEnv() in fixtures.ts to check the publishable key mode before
calling clerkSetup(), mirroring the runtime guard used by the app, and skip
Clerk setup when the key is not development so electronExecutable() and the rest
of the fixture setup still work.

---

Nitpick comments:
In `@integration/templates/electron-vite/main.mjs`:
- Around line 25-30: The BrowserWindow configuration in main.mjs disables the
renderer sandbox via webPreferences.sandbox = false, weakening the isolation
this template is meant to test. Update the BrowserWindow/webPreferences setup to
keep sandbox enabled if `@clerk/electron` still works with the preload bridge
under Electron’s default sandbox; otherwise leave the value as-is but add an
inline note in the same configuration block explaining the incompatibility. Use
the BrowserWindow options and preload.mjs reference to locate the change.

In `@integration/templates/electron-vite/tsconfig.json`:
- Line 19: The Electron Vite template tsconfig currently only includes src, so
the root vite.config.ts is excluded from TypeScript checking. Update the
tsconfig include list used by the template to cover vite.config.ts as well, or
split the app and Node/Vite configs so the config file is typechecked by the
appropriate tsconfig.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d0ce248e-b18c-4057-91a6-21d3d4e243eb

📥 Commits

Reviewing files that changed from the base of the PR and between 7a5e27f and 655da71.

📒 Files selected for processing (18)
  • .changeset/electron-e2e-tests.md
  • .github/workflows/ci.yml
  • integration/presets/electron.ts
  • integration/presets/index.ts
  • integration/templates/electron-vite/index.html
  • integration/templates/electron-vite/main.mjs
  • integration/templates/electron-vite/package.json
  • integration/templates/electron-vite/preload.mjs
  • integration/templates/electron-vite/src/main.tsx
  • integration/templates/electron-vite/src/style.css
  • integration/templates/electron-vite/src/vite-env.d.ts
  • integration/templates/electron-vite/tsconfig.json
  • integration/templates/electron-vite/vite.config.ts
  • integration/templates/index.ts
  • integration/tests/electron/basic.test.ts
  • integration/tests/electron/fixtures.ts
  • package.json
  • turbo.json

Comment on lines +9 to +12
.addScript('setup', 'pnpm install')
.addScript('dev', 'pnpm build')
.addScript('build', 'pnpm build')
.addScript('serve', 'echo noop')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Wire dev and serve to real commands.

pnpm dev currently just performs a build, and pnpm serve exits immediately, so the generated Electron template has no runnable development or start path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/presets/electron.ts` around lines 9 - 12, The Electron preset
currently wires the package scripts in `integration/presets/electron.ts` so
`dev` only builds and `serve` is a noop, which leaves no runnable app flow.
Update the `addScript('dev', ...)` and `addScript('serve', ...)` entries to
point to the actual Electron development and startup commands used by the
template, keeping `setup` and `build` unchanged. Use the existing script wiring
in the preset as the place to fix this so generated projects expose a real `dev`
path and a real `serve` path.

Comment thread integration/templates/electron-vite/package.json
Comment on lines +7 to +8
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY as string;
const CLERK_UI_URL = import.meta.env.VITE_CLERK_UI_URL as string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Validate the required Vite env vars at startup.

The as string assertions only silence TypeScript; an unset VITE_CLERK_* still flows through as undefined and fails later inside Clerk initialization. Throw a clear startup error here instead.

🛠️ Proposed change
-const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY as string;
-const CLERK_UI_URL = import.meta.env.VITE_CLERK_UI_URL as string;
+const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
+const CLERK_UI_URL = import.meta.env.VITE_CLERK_UI_URL;
+
+if (!PUBLISHABLE_KEY || !CLERK_UI_URL) {
+  throw new Error('Missing VITE_CLERK_PUBLISHABLE_KEY or VITE_CLERK_UI_URL for the Electron renderer');
+}

As per coding guidelines, "Validate all inputs and sanitize outputs" and "Provide meaningful error messages to developers".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY as string;
const CLERK_UI_URL = import.meta.env.VITE_CLERK_UI_URL as string;
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
const CLERK_UI_URL = import.meta.env.VITE_CLERK_UI_URL;
if (!PUBLISHABLE_KEY || !CLERK_UI_URL) {
throw new Error('Missing VITE_CLERK_PUBLISHABLE_KEY or VITE_CLERK_UI_URL for the Electron renderer');
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/templates/electron-vite/src/main.tsx` around lines 7 - 8, The
startup constants in main.tsx rely on TypeScript assertions only, so missing
VITE_CLERK_PUBLISHABLE_KEY or VITE_CLERK_UI_URL can still reach Clerk as
undefined. Update the initialization around PUBLISHABLE_KEY and CLERK_UI_URL to
validate both env vars immediately at startup and throw a clear,
developer-facing error if either is absent or empty. Keep the check close to the
existing env reads so the failure happens before Clerk setup, and make the
message specific enough to identify which required variable is missing.

Source: Coding guidelines

Comment thread integration/tests/electron/fixtures.ts
Comment thread integration/tests/electron/fixtures.ts Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +490 to +497
- name: Ensure Xvfb is installed
if: ${{ matrix.test-name == 'electron' }}
run: |
if ! command -v xvfb-run &> /dev/null; then
sudo apt-get update
sudo apt-get install -y xvfb
fi
xvfb-run --help > /dev/null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need xvfb because the Electron E2E launches a real BrowserWindow in Linux CI, where there's no display server by default. xvfb-run provides a virtual display, and it's only installed/used for the Electron matrix job

@jeremy-clerk jeremy-clerk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few low-severity reliability/cleanup notes from a review pass. No correctness bugs; the Electron-specific details (privileged scheme timing, bundled clerk-js vs. served UI, pnpm-blocked binary install) all look correct.

Comment thread integration/tests/electron/fixtures.ts Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread integration/templates/electron-vite/main.mjs Outdated
Comment thread integration/presets/electron.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
integration/tests/electron/basic.test.ts (2)

30-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Collapsing five bridge checks into one boolean hides which method is missing.

If this assertion fails, Playwright only reports expected false to be true, giving no signal about which of the five bridge methods is absent. Returning the missing keys (or asserting each individually) makes regressions debuggable.

♻️ Surface the missing methods
     await expect(
       electronPage.evaluate(() => {
         const bridge = (window as ElectronWindow).__clerk_internal_electron;

-        return (
-          typeof bridge?.tokenCache?.clearToken === 'function' &&
-          typeof bridge?.tokenCache?.getToken === 'function' &&
-          typeof bridge?.tokenCache?.saveToken === 'function' &&
-          typeof bridge?.oauthTransport?.getRedirectUrl === 'function' &&
-          typeof bridge?.oauthTransport?.open === 'function'
-        );
+        return {
+          clearToken: typeof bridge?.tokenCache?.clearToken,
+          getToken: typeof bridge?.tokenCache?.getToken,
+          saveToken: typeof bridge?.tokenCache?.saveToken,
+          getRedirectUrl: typeof bridge?.oauthTransport?.getRedirectUrl,
+          open: typeof bridge?.oauthTransport?.open,
+        };
       }),
-    ).resolves.toBe(true);
+    ).resolves.toEqual({
+      clearToken: 'function',
+      getToken: 'function',
+      saveToken: 'function',
+      getRedirectUrl: 'function',
+      open: 'function',
+    });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/tests/electron/basic.test.ts` around lines 30 - 46, The preload
bridge test in the electron basic spec is too opaque because it collapses all
five method checks on __clerk_internal_electron into one boolean. Update the
test in the expose-bridge case so failures identify which symbol is missing,
either by asserting each bridge method separately or by returning the missing
keys from the electronPage.evaluate block; keep the checks focused on
tokenCache.clearToken, tokenCache.getToken, tokenCache.saveToken,
oauthTransport.getRedirectUrl, and oauthTransport.open.

62-76: 🩺 Stability & Availability | 🔵 Trivial

Make relaunch explicit in these tests.
electronApplication and electronPage are test-scoped, so each case already gets a fresh Electron launch. That makes the current assertions rely on fixture scope; if either fixture becomes worker-scoped later, the relaunch coverage disappears while the tests still pass. Consider moving the close/relaunch into the test or locking the fixture scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration/tests/electron/basic.test.ts` around lines 62 - 76, The relaunch
behavior in these Electron session tests is currently implicit because
`electronApplication` and `electronPage` are test-scoped, so the cases only
verify state on a fresh launch rather than an actual close-and-reopen flow.
Update the tests in `basic.test.ts` to make the relaunch explicit by closing the
app/page and reopening it within the test, or otherwise lock the fixture scope
so `persists the signed-in session after relaunch` and `keeps the signed-out
state after relaunch` truly cover relaunch behavior. Keep the existing
assertions around `electronPage` and the Clerk sign-in/sign-out flow, but ensure
they run after an explicit restart step.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@integration/tests/electron/basic.test.ts`:
- Around line 30-46: The preload bridge test in the electron basic spec is too
opaque because it collapses all five method checks on __clerk_internal_electron
into one boolean. Update the test in the expose-bridge case so failures identify
which symbol is missing, either by asserting each bridge method separately or by
returning the missing keys from the electronPage.evaluate block; keep the checks
focused on tokenCache.clearToken, tokenCache.getToken, tokenCache.saveToken,
oauthTransport.getRedirectUrl, and oauthTransport.open.
- Around line 62-76: The relaunch behavior in these Electron session tests is
currently implicit because `electronApplication` and `electronPage` are
test-scoped, so the cases only verify state on a fresh launch rather than an
actual close-and-reopen flow. Update the tests in `basic.test.ts` to make the
relaunch explicit by closing the app/page and reopening it within the test, or
otherwise lock the fixture scope so `persists the signed-in session after
relaunch` and `keeps the signed-out state after relaunch` truly cover relaunch
behavior. Keep the existing assertions around `electronPage` and the Clerk
sign-in/sign-out flow, but ensure they run after an explicit restart step.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f6f4d51-ac6b-42ce-8b9b-4c7dd3c5f811

📥 Commits

Reviewing files that changed from the base of the PR and between 7dd38a7 and 6a98c41.

📒 Files selected for processing (1)
  • integration/tests/electron/basic.test.ts

@jeremy-clerk jeremy-clerk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits but looks good 👍 let me know what we need to do for passkey test support

@wobsoriano wobsoriano merged commit bc495c1 into main Jun 26, 2026
50 checks passed
@wobsoriano wobsoriano deleted the rob/user-5628-setup-e2e-tests-for-electron-sdk branch June 26, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants