Skip to content

Add RTL tests for the PendingValidations urgency-sort queue #136

@1nonlypiece

Description

@1nonlypiece

📌 Description

src/pages/PendingValidations.tsx is the verifier's working queue. It sorts
pending tasks by daysRemaining and toggles between ascending/descending
urgency, reads from the Zustand useVerifierStore, and navigates into
ValidationDetail. It has no test file, so the sort toggle, empty-queue
state, and row navigation are untested.

This issue adds RTL coverage for the pending validations queue.

Goal: test the urgency sort toggle, empty state, and row-to-detail
navigation with the store mocked.

🎯 Requirements and Context

  • Mock useVerifierStore (src/Zustand/Store.ts) to supply a set of
    ValidationTasks with varied daysRemaining.
  • Assert default sort order, that toggling reverses it, and that the toggle label
    updates (High to LowLow to High).
  • Assert the "All caught up!" empty state when there are no pending validations.
  • Assert clicking a row navigates to the corresponding ValidationDetail route.

🛠️ Suggested Execution

1. Create a branch

git checkout -b feature/test-pending-validations

2. Implement changes

  • Tests: add src/pages/__tests__/PendingValidations.test.tsx using RTL,
    MemoryRouter, and a mocked store + useNavigate.

3. Test and commit

  • Run npm run test from the repo root.
  • Cover edge cases: empty queue, single task, ties in daysRemaining, toggle
    twice returns to original order.

Example commit message

test: add RTL coverage for PendingValidations queue

✅ Guidelines

  • Minimum 95% test coverage on PendingValidations.tsx.
  • Clear, behavior-focused test names.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing · area-frontend · MAYBE REWARDED · GRANTFOX OSS ·
OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the Disciplr contributor Discord to coordinate and get unblocked fast:
    https://discord.gg/xvNAvMJf
  • Please introduce yourself before you start so we can avoid duplicate work.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions