Skip to content

Conversation

@panteliselef
Copy link
Member

@panteliselef panteliselef commented Nov 9, 2025

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

  • Tests
    • Added integration tests covering billing workflows: billing history, statements, and payment attempt navigation to ensure those flows work end-to-end.
  • Chores
    • Added a placeholder changelog entry file (no runtime behavior changes).

@panteliselef panteliselef self-assigned this Nov 9, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2025

🦋 Changeset detected

Latest commit: ff39688

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 Nov 9, 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 Nov 9, 2025 4:53pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds a placeholder changeset file and a new integration test that automates user sign-in and exercises billing UI flows (statements, statement details, payment attempts). The diff contains a duplicated insertion of the same test block.

Changes

Cohort / File(s) Change Summary
Changeset Entry
\.changeset/yellow-pants-act.md
Adds a placeholder changeset file containing only separator lines (---) with no runtime or config changes.
Billing Integration Test
integration/tests/pricing-table.test.ts
Adds an integration test that signs in a user, navigates to billing, verifies billing statements and statement details, inspects payment attempts, and asserts data consistency. The same test block appears duplicated in the diff — confirm single intended insertion.

Sequence Diagram(s)

sequenceDiagram
    participant Tester as Integration Test
    participant Browser as Headless Browser
    participant App as Web App (UI)
    participant API as Billing API
    participant DB as Database

    Tester->>Browser: start test & sign in
    Browser->>App: visit /account/billing
    App->>API: fetch statements list
    API->>DB: query statements
    DB-->>API: return statements
    API-->>App: statements payload
    App-->>Browser: render statements

    alt open statement details
        Browser->>App: click statement
        App->>API: fetch statement details
        API->>DB: query payments / attempts
        DB-->>API: return payments
        API-->>App: details payload
        App-->>Browser: render details
    end

    alt inspect payment attempt
        Browser->>App: click payment attempt
        App->>API: fetch attempt details
        API->>DB: return attempt data
        API-->>App: attempt payload
        App-->>Browser: render attempt
    end

    Tester->>Browser: cleanup (delete test user)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check for and remove the duplicated test block in integration/tests/pricing-table.test.ts.
  • Verify test assertions align with current billing UI selectors and API response shapes.
  • Confirm the test teardown reliably removes test user and related billing records.
  • Ensure the placeholder changeset follows the repository's changeset conventions (if required).

Poem

🐰
I hopped through tests with gentle paws,
Counting statements, reading clause by clause.
Payments twirled, attempts took a peek,
I left one change — tiny, meek.
Hooray for green runs and tidy logs! 🥕

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 reflects the main change: adding end-to-end test coverage for billing statements and payment attempts, which aligns with the new integration test added to pricing-table.test.ts.
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 elef/e2e-tests-for-statements

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 9, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ff39688

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: 2

📜 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 539fad7 and fac07e4.

📒 Files selected for processing (2)
  • .changeset/yellow-pants-act.md (1 hunks)
  • integration/tests/pricing-table.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/yellow-pants-act.md
**/*.{js,jsx,ts,tsx}

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

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

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

Use Prettier for consistent code formatting

Files:

  • integration/tests/pricing-table.test.ts
**/*.{ts,tsx}

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

Use proper TypeScript error types

**/*.{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
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
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • integration/tests/pricing-table.test.ts
integration/**

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

Framework integration templates and E2E tests should be placed under the integration/ directory

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*

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

End-to-end tests and integration templates must be located in the 'integration/' directory.

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*.{test,spec}.{js,ts}

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

Integration tests should use Playwright.

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,ts,tsx,jsx}

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

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • integration/tests/pricing-table.test.ts
🧬 Code graph analysis (1)
integration/tests/pricing-table.test.ts (1)
integration/testUtils/index.ts (1)
  • createTestUtils (24-86)
🪛 ast-grep (0.39.7)
integration/tests/pricing-table.test.ts

[warning] 759-759: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(date, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 LanguageTool
.changeset/yellow-pants-act.md

[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---

(QB_NEW_DE)

⏰ 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). (29)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (express, 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: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)

@blacksmith-sh

This comment has been minimized.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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

🧹 Nitpick comments (1)
integration/tests/pricing-table.test.ts (1)

675-697: Consider adding explicit return type annotations.

Per the coding guidelines for TypeScript, functions should have explicit return types. While these are local test helpers where inference is clear, adding return types would improve consistency and catch potential issues earlier.

Apply this diff to add return types:

-        const openBillingTab = async (label: RegExp) => {
+        const openBillingTab = async (label: RegExp): Promise<void> => {
           await page.getByRole('tab', { name: label }).click();
           await page
             .locator('.cl-userProfile-root [role="tabpanel"] .cl-table')
             .waitFor({ state: 'visible', timeout: 15000 });
         };
-        const getBillingTableRows = () => {
+        const getBillingTableRows = (): Locator => {
           return page.locator('.cl-userProfile-root .cl-tableBody .cl-tableRow');
         };
-        const waitForBillingTableRows = async (options?: { hasText?: string | RegExp }) => {
+        const waitForBillingTableRows = async (options?: { hasText?: string | RegExp }): Promise<Locator> => {
           const rows = getBillingTableRows();
           if (options?.hasText) {
             await rows
📜 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 fac07e4 and ff39688.

📒 Files selected for processing (1)
  • integration/tests/pricing-table.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

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

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

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

Use Prettier for consistent code formatting

Files:

  • integration/tests/pricing-table.test.ts
**/*.{ts,tsx}

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

Use proper TypeScript error types

**/*.{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
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
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • integration/tests/pricing-table.test.ts
integration/**

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

Framework integration templates and E2E tests should be placed under the integration/ directory

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*

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

End-to-end tests and integration templates must be located in the 'integration/' directory.

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*.{test,spec}.{js,ts}

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

Integration tests should use Playwright.

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,ts,tsx,jsx}

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

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • integration/tests/pricing-table.test.ts
🧬 Code graph analysis (1)
integration/tests/pricing-table.test.ts (1)
integration/testUtils/index.ts (1)
  • createTestUtils (24-86)
🪛 ast-grep (0.39.7)
integration/tests/pricing-table.test.ts

[warning] 759-759: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(date, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

⏰ 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). (30)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Static analysis
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
integration/tests/pricing-table.test.ts (4)

658-666: LGTM! Well-structured test setup.

The test is properly structured with a descriptive name and appropriate setup. The try-finally block ensures proper cleanup of the fake user.


675-718: Well-structured helper functions improve test readability.

The helper functions effectively encapsulate common operations and make the test more maintainable. Line 717 correctly awaits the detachment without swallowing errors, which properly surfaces UI regressions if the detail view fails to unmount.


766-789: Excellent validation of statement and payment details.

The test properly validates the relationship between statements and payment attempts, including:

  • Navigating through the billing UI hierarchy
  • Verifying matching totals between statement and payment
  • Checking plan names appear correctly in both views

This provides strong coverage for the billing history feature.


796-807: Good coverage of failed payment scenario.

The test properly verifies the failed payment attempt details, including the status badge and plan information. This complements the successful payment verification and provides comprehensive coverage of the payment history feature.

@blacksmith-sh

This comment has been minimized.

@panteliselef panteliselef merged commit e610b92 into main Nov 10, 2025
70 of 71 checks passed
@panteliselef panteliselef deleted the elef/e2e-tests-for-statements branch November 10, 2025 12:27
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