Skip to content

test(e2e): add AP Core 3 migration coverage#7884

Open
nikosdouvlis wants to merge 1 commit intomainfrom
nk/ap-core3-migration-tests
Open

test(e2e): add AP Core 3 migration coverage#7884
nikosdouvlis wants to merge 1 commit intomainfrom
nk/ap-core3-migration-tests

Conversation

@nikosdouvlis
Copy link
Member

@nikosdouvlis nikosdouvlis commented Feb 19, 2026

Account Portal is being auto-bumped to Core 3 for all instances. All existing Core 2 and Core 3 apps must continue working. The existing AP flow tests only covered happy-path sign-in/sign-up/SSR for v6 and v7 SDKs, which left gaps in backwards compatibility validation and edge case coverage.

What changed

Added three categories of tests to the @ap-flows integration suite:

v5 SDK backwards compatibility (new test file):

  • Sign-in, sign-up, and SSR tests for @clerk/nextjs@5 (from npm) against the Core 3 staging AP
  • v5 is the oldest supported Core 2 SDK and uses the legacy token-based handshake (no format=nonce), so this validates that Core 3 FAPI still supports the older handshake protocol
  • Reuses the v6 template since both SDKs share the same component and middleware APIs

Sign-out after AP-established session (added to v6 and v7 suites):

  • Signs in via Core 3 AP, signs out via Clerk.signOut()
  • Verifies __session cookie is cleared
  • Verifies reload stays signed out (no auto-sign-in from stale cross-domain state)
  • Verifies AP shows sign-in form on next visit

Handshake recovery after session cookie loss (added to v6 and v7 suites):

  • Signs in via Core 3 AP, deletes __session cookie to simulate expiry
  • Reloads the page, which forces middleware to trigger a handshake to FAPI
  • Verifies the handshake recovers the session (user ends up signed in)
  • Verifies no redirect loop and no leftover handshake params in the URL

Test matrix after this PR

Test V5 (Core 2) V6 (Core 2) V7 (Core 3)
Sign-in New Existing Existing
Sign-up New Existing Existing
SSR New Existing Existing
Sign-out + AP state - New New
Handshake recovery - New New

Test plan

  • All existing @ap-flows tests still pass (v6, v7 sign-in/sign-up/SSR)
  • New v5 tests pass against Core 3 staging AP
  • Sign-out tests verify clean session state after sign-out
  • Handshake recovery tests verify session restoration without redirect loops

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Tests

    • Added integration test suite for Clerk V5 with Account Portal Core 3, covering sign-in, sign-up, and server-side rendering scenarios.
    • Added test coverage for session management, including sign-out behavior and handshake recovery after session loss.
  • Chores

    • Added new environment and Next.js configuration presets to support Clerk V5 integration.

…out, and handshake recovery

Why:
Account Portal is being auto-bumped to Core 3 for all instances. Existing
tests only cover happy-path sign-in/sign-up/SSR for v6 and v7 SDKs. This
leaves gaps in backwards compatibility validation for older SDKs and in
edge cases that could surface Core 2/Core 3 protocol differences.

What changed:
- Added v5 @clerk/nextjs test suite against Core 3 staging AP (sign-in,
  sign-up, SSR) to validate the oldest supported Core 2 SDK still works
  with Core 3 AP using the legacy token-based handshake protocol.
- Added sign-out test to v6 and v7 suites: signs in via AP, signs out,
  verifies session cookie is cleared, reload stays signed out, and AP
  shows sign-in form on next visit (no stale cross-domain state).
- Added handshake recovery test to v6 and v7 suites: signs in via AP,
  deletes __session cookie to simulate expiry, reloads page, verifies
  handshake recovers the session without redirect loop and no leftover
  handshake params in the URL.
- Added withAPCore3ClerkV5 env and appRouterAPWithClerkNextV5 app config
  (reuses v6 template since both use SignedIn/SignedOut and clerkMiddleware).
@vercel
Copy link

vercel bot commented Feb 19, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 19, 2026 11:34am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: 63c86ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

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

@nikosdouvlis nikosdouvlis changed the title test(integration): add AP Core 3 migration coverage test(e2e): add AP Core 3 migration coverage Feb 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

This pull request adds support for Clerk V5 integration with Account Portal Core 3. It introduces a new environment configuration and Next.js preset for this integration, creates a new test suite to verify the integration functionality, and adds two new test helper functions (testSignOut and testHandshakeRecovery) that are incorporated into existing test suites for V6 and V7 versions. The changes establish baseline testing and configuration infrastructure for the Clerk V5 variant.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding integration tests for Account Portal Core 3 migration coverage, which aligns with all file changes in the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 19, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7884

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7884

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 63c86ac

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.

1 participant

Comments