test(fe): regression guards for metric-render bugs + fix theme crash (#1294)#163
test(fe): regression guards for metric-render bugs + fix theme crash (#1294)#163SharedQA wants to merge 1 commit into
Conversation
…(#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>
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
What
localStorage(as Theme). A stale/edited or whitespace value ("light dark") flowed intoclassList.add()→InvalidCharacterError→ app crash at the error boundary. Now validated against the known set + guarded for Safari private-mode throws. 4 tests.0/0%when its source isn't ingested), no fabricated delta when the prior period is absent, and delta direction respectshigher_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.