Skip to content

test(fe): regression guards for metric-render bugs + fix theme crash (#1294)#163

Open
SharedQA wants to merge 1 commit into
constructorfabric:mainfrom
SharedQA:claude/fe-regression-suite
Open

test(fe): regression guards for metric-render bugs + fix theme crash (#1294)#163
SharedQA wants to merge 1 commit into
constructorfabric:mainfrom
SharedQA:claude/fe-regression-suite

Conversation

@SharedQA

Copy link
Copy Markdown

What

  • theme-provider (#1294): stop trusting localStorage (as Theme). A stale/edited or whitespace value ("light dark") flowed into classList.add()InvalidCharacterError → app crash at the error boundary. Now validated against the known set + guarded for Safari private-mode throws. 4 tests.
  • transforms regression guards (#1337): lock the already-correct not-ingested(NULL) vs zero distinction (a metric never renders 0/0% when its source isn't ingested), no fabricated delta when the prior period is absent, and delta direction respects higher_is_better. 5 tests.

Verified

vitest (88 pass), tsc --noEmit, eslint --max-warnings 0 — all clean.

These cover frontend bug classes we hit repeatedly (silent wrong/blank numbers, theme crash) that had no in-repo regression coverage.

…(#1294)

The frontend bug classes we hit repeatedly (silent wrong/blank numbers) had no
in-repo regression coverage. This adds it, and fixes the one genuinely-open bug:

- theme-provider: stop trusting localStorage (`as Theme`). A stale/edited or
  whitespace value ("light dark") flowed into classList.add() and threw
  InvalidCharacterError, crashing the app at the error boundary (#1294). Validate
  against the known set + guard localStorage access (Safari private mode). 4 tests.
- transforms.regression: lock the already-correct not-ingested(NULL)-vs-zero
  distinction so a metric never renders "0"/"0%" when its source isn't ingested
  (#1337), no fabricated delta when the prior period is absent, and delta
  direction respects higher_is_better. 5 tests.

vitest (88 pass), tsc --noEmit, and eslint --max-warnings 0 all clean.

Signed-off-by: Kenan Salim <kenan.salim@rolos.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SharedQA, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 41 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b571161e-9f4c-4de0-b791-129b76bc3c43

📥 Commits

Reviewing files that changed from the base of the PR and between bddede7 and 4c0ef33.

📒 Files selected for processing (3)
  • src/api/transforms.regression.test.ts
  • src/components/theme-provider.test.tsx
  • src/components/theme-provider.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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