Skip to content

test(widgets): add unit tests for useTableState#1753

Open
pranvxag wants to merge 1 commit into
Karanjot786:mainfrom
pranvxag:test/table-state-unit-tests
Open

test(widgets): add unit tests for useTableState#1753
pranvxag wants to merge 1 commit into
Karanjot786:mainfrom
pranvxag:test/table-state-unit-tests

Conversation

@pranvxag

Copy link
Copy Markdown

Description

Adds 10 unit tests for useTableState in @termuijs/widgets which had no
test coverage. Tests cover initialization, setRows with scrollOffset
clamping, scrollNext and scrollPrev including boundary behavior.

Related Issue

Closes #1752

Which package(s)?

@termuijs/widgets

Type of Change

  • 🐛 Bug fix (type:bug)
  • ✨ Feature (type:feature)
  • 📝 Docs (type:docs)
  • 🧪 Tests (type:testing)
  • ♻️ Refactor (type:refactor)
  • 🎨 Design / UX (type:design)
  • ♿ Accessibility (type:accessibility)
  • ⚡ Performance (type:performance)
  • 🔧 DevOps / CI (type:devops)
  • 🔒 Security (type:security)

Checklist

  • ⭐ You starred the repo. The needs-star check blocks your merge otherwise.
  • Tests pass locally: bun vitest run
  • Build passes: bun run build
  • Typecheck passes: bun run typecheck
  • You read CONTRIBUTING.md.
  • Your PR title follows type: short description.
  • Widget state mutators call markDirty() (if your change affects rendering).
  • No new any types without an inline comment explaining why.
  • No unrelated refactors bundled into this PR.

GSSoC 2026 Participation

Notes for the Reviewer

TableState.ts had zero test coverage. All 10 tests pass locally.
Full widgets suite (125 files, 1370 tests) passes with no regressions.

I reviewed each test case against the source code manually and verified all pass locally.

@pranvxag pranvxag requested a review from Karanjot786 as a code owner June 22, 2026 10:22
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

More reviews will be available in 4 minutes and 18 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 438ed44d-5a07-4b90-baa5-fc812486fcae

📥 Commits

Reviewing files that changed from the base of the PR and between 35c2213 and 3defee5.

📒 Files selected for processing (1)
  • packages/widgets/src/data/TableState.test.ts
✨ 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.

@github-actions github-actions Bot added type:testing +10 pts. Tests. area:widgets @termuijs/widgets labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:widgets @termuijs/widgets type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[test] Add unit tests for useTableState in @termuijs/widgets

1 participant