Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Dec 2, 2025

Description

Updates E2E reset password task errors to handle untrusted password error on sing-in

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

  • Tests

    • Improved sign-in/password-reset tests to assert visible error feedback, exercise the alternate “Use Another Method” email code flow, and verify end-to-end sign-in and redirects; test data creation now ensures unique organization identifiers.
  • Chores

    • Added a changeset metadata file to coordinate the upcoming release.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

🦋 Changeset detected

Latest commit: 387f762

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

@vercel
Copy link

vercel bot commented Dec 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Dec 2, 2025 6:51pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

Adds a new changeset placeholder file and updates an integration test to import Playwright's expect, assert a "password compromised" error, switch the sign-in flow to "Use Another Method" → email-code before entering the code, and make the test org slug unique via a timestamp.

Changes

Cohort / File(s) Summary
Changelog
/.changeset/funny-crabs-crash.md
Adds a new changelog placeholder file containing --- content; no runtime changes.
Integration test
integration/tests/session-tasks-sign-in-reset-password.test.ts
Imports expect; asserts password-compromised feedback visibility; changes sign-in flow to click "Use Another Method" → select email-code then enter code; appends timestamp to organization slug for uniqueness.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify the exact selector/text used for the "password compromised" assertion matches the UI.
  • Confirm the "Use Another Method" and email-code button selectors/responses align with current flows.
  • Ensure the timestamped slug doesn't introduce flakiness in test setup or collisions.

Poem

🐰 I hopped through tests with eager paws,
Clicked "Another Method" and followed the cause,
A tiny changelog tucked in a file,
A timestamped slug made me smile,
Codes and checks — a rabbit's little applause 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: updating E2E tests to handle an untrusted password error that appears on sign-in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaggelis/update-reset-password-e2e-tests

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ccce693 and 387f762.

📒 Files selected for processing (1)
  • integration/tests/session-tasks-sign-in-reset-password.test.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration/tests/session-tasks-sign-in-reset-password.test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (34)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Unit Tests (22, shared, clerk-js, RQ)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

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

@octoper octoper marked this pull request as ready for review December 2, 2025 17:56
@octoper octoper self-assigned this Dec 2, 2025
@octoper octoper closed this Dec 2, 2025
@octoper octoper reopened this Dec 2, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ce8b914 and 6b2ffb5.

📒 Files selected for processing (2)
  • .changeset/funny-crabs-crash.md (1 hunks)
  • integration/tests/session-tasks-sign-in-reset-password.test.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{test,spec}.{ts,tsx,js,jsx}: Unit tests are required for all new functionality
Verify proper error handling and edge cases
Include tests for all new features

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.{test,spec,e2e}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use real Clerk instances for integration tests

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • integration/tests/session-tasks-sign-in-reset-password.test.ts
🔇 Additional comments (2)
integration/tests/session-tasks-sign-in-reset-password.test.ts (2)

1-1: LGTM!

The addition of expect to the import is correct and necessary for the new visibility assertions added in the test cases.


34-36: Method exists and implementation is correct; remove misleading claims about test flow.

The getAltMethodsEmailCodeButton() method is properly defined in the page object and the regex pattern for the "password compromised" message is appropriate. However, the original comment incorrectly characterizes the test behavior: the test DOES re-enter the code after clicking the alternate methods button (line 40 calls u.enterEmailCodeAndContinue()), and it completes a full authentication cycle including password reset rather than testing an incomplete flow.

Likely an incorrect or invalid review comment.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 2, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7345

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7345

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7345

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7345

@clerk/upgrade

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

@clerk/vue

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

commit: 387f762

Copy link
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

🧪

@octoper octoper enabled auto-merge (squash) December 2, 2025 18:53
@octoper octoper merged commit e113464 into main Dec 2, 2025
45 of 46 checks passed
@octoper octoper deleted the vaggelis/update-reset-password-e2e-tests branch December 2, 2025 18:59
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.

4 participants