Skip to content

test(oauth): cover connector-store lifecycle and OAuth route handlers - #19

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-538e
Draft

test(oauth): cover connector-store lifecycle and OAuth route handlers#19
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-538e

Conversation

@cursor

@cursor cursor Bot commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Adds regression tests for OAuth and connector lifecycle from PR #15 (design system + OAuth/CSP hardening).

Risky behavior now covered

  • Connector status transitions on add/delete (connected ↔ disconnected)
  • OAuth authorize: 401 unauthenticated, PKCE cookie issuance, 400 invalid connector
  • OAuth callback: provider error, missing params, invalid state, successful token exchange + connection persistence
  • OAuth refresh: 404 unknown connection, 400 missing refresh token
  • PKCE cookie serialization/clear flags and unknown-provider errors

Test files added/updated

  • tests/lib/connector-store.test.ts (new, 5 tests)
  • tests/api/oauth-routes.test.ts (new, 9 tests)
  • tests/lib/oauth-manager.test.ts (+3 tests)

Why these tests materially reduce regression risk

Lib-level PKCE tests did not cover HTTP route boundaries (cookie set/clear, redirects, auth gates). Connector-store mutations drive UI status; untested delete logic could leave connectors stuck in wrong states.

How tested

npm run test:run -- tests/lib/connector-store.test.ts tests/api/oauth-routes.test.ts tests/lib/oauth-manager.test.ts

21/21 passed.

Open in Web View Automation 

Add regression tests for PKCE cookie flags, connector status transitions,
and authorize/callback/refresh HTTP boundaries from PR #15 OAuth hardening.

Co-authored-by: esadrianno <esadrianno@gmail.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
v0-agent-kit Ready Ready Preview, Comment, Open in v0 Jun 27, 2026 12:09pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant