test: add unit tests for useListState functionality#1751
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new Vitest test file ChangesuseListState Test Suite
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Description
Adds 15 unit tests for useListState in @termuijs/widgets which had no
test coverage. Tests cover initialization, setItems with boundary
clamping, selectNext/selectPrev navigation, disabled item skipping,
scrollOffset updates, and confirm no-op behavior.
Related Issue
Closes #1749
Which package(s)?
@termuijs/widgets
Type of Change
type:bug)type:feature)type:docs)type:testing)type:refactor)type:design)type:accessibility)type:performance)type:devops)type:security)Checklist
needs-starcheck blocks your merge otherwise.bun vitest runbun run buildbun run typecheckCONTRIBUTING.md.type: short description.markDirty()(if your change affects rendering).anytypes without an inline comment explaining why.GSSoC 2026 Participation
Notes for the Reviewer
ListState.ts had zero test coverage. All 15 tests pass locally.
Full widgets suite (125 files, 1375 tests) passes with no regressions.
I reviewed each test case against the source code manually and verified all pass locally.
Summary by CodeRabbit