test(coverage): Batch 1 — RadioGroup, Tabs, factoryResetService#132
Conversation
#3 coverage lift — three previously-0% modules now tested (targets chosen from the CI V8 per-file branch report, baseline B63.15): - components/ui/RadioGroup.tsx — radiogroup role/label, checked state, onChange, disabled, orientation (6 tests). - components/ui/Tabs.tsx — Tabs + TabPanel: tablist/tab roles, aria-selected, onChange, disabled, variants, panel visibility (8 tests). - services/factoryResetService.ts — wipeAllAppData: web-storage clear, IDB deletion, databases() fallback branch, Cache API branch, reload (3 tests). Gates: lint OK (1328 files) | typecheck OK | 17 new tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
@CodeAnt-AI review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
CodeAnt AI is running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
CodeAnt AI finished reviewing your PR. |
…132) Replace the real 300ms reload-settle wait with vi.useFakeTimers() + runAllTimersAsync() (also flushes fake-indexeddb deletion scheduling), making the suite deterministic and ~8x faster (136ms vs ~1s). Addresses the CodeAnt minor suggestion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
|
CodeAnt AI is running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram summarizes how the factory reset service deletes IndexedDB databases (with a fallback when listing fails), clears service worker caches and web storage, waits briefly, and then reloads the app, which is the main behavior covered by the new tests. sequenceDiagram
participant App
participant FactoryResetService
participant IndexedDB
participant Caches
participant WebStorage
participant Browser
App->>FactoryResetService: Trigger factory reset
FactoryResetService->>IndexedDB: Delete all app databases
alt databases listing works
IndexedDB-->>FactoryResetService: Return databases to delete
else listing fails
FactoryResetService->>IndexedDB: Delete known database names
end
FactoryResetService->>Caches: Clear service worker caches if available
FactoryResetService->>WebStorage: Clear local and session storage
FactoryResetService->>FactoryResetService: Wait for short settle delay
FactoryResetService->>Browser: Reload page
Generated by CodeAnt AI |
|
CodeAnt AI finished running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
User description
Summary
Coverage lift Batch 1 (plan #3 / TODO v1.23 P1). Three previously-0% modules now have deterministic unit tests. Targets were chosen from the CI V8 per-file branch report harvested from the #131 Quality Gate (baseline B63.15), not from a heuristic.
components/ui/RadioGroup.tsxonChange(value), disabled option, vertical/horizontal orientationcomponents/ui/Tabs.tsx(Tabs + TabPanel)aria-selected,onChange(id), disabled tab, pills/underline variant,data-state, panel show/hide + aria wiringservices/factoryResetService.tswipeAllAppData: web-storage clear, IDB deletion,databases()-fails fallback branch, Cache API branch, reloadAlso closes the long-standing "add unit tests for RadioGroup/Tabs" item from the v1.20 UI-Modernization list.
Notes
fake-indexeddb/auto;factoryResetServiceuses real timers (300 ms settle) and a scopedwindow.location.reloadstub.Gates
🤖 Generated with Claude Code
CodeAnt-AI Description
Add unit coverage for RadioGroup, Tabs, and app reset behavior
What Changed
Impact
✅ Fewer regressions in radio and tab controls✅ Safer app reset flow✅ Clearer coverage for storage and cache cleanup💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.