Skip to content

test: cover verifier batchApprove/batchReject duplicate & all-unknown id edge cases#511

Open
Dennis-Ritchie1 wants to merge 1 commit into
Disciplr-Org:mainfrom
Dennis-Ritchie1:test/verifier-store-batch-edge-cases
Open

test: cover verifier batchApprove/batchReject duplicate & all-unknown id edge cases#511
Dennis-Ritchie1 wants to merge 1 commit into
Disciplr-Org:mainfrom
Dennis-Ritchie1:test/verifier-store-batch-edge-cases

Conversation

@Dennis-Ritchie1

@Dennis-Ritchie1 Dennis-Ritchie1 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

test: cover verifier batchApprove/batchReject duplicate & all-unknown id edge cases

Closes #335

Summary

src/Zustand/Store.ts's batchApprove/batchReject are implemented by calling
the single-task mutators per id via get(). The store already had tests for the
core batch path (transitions, mixed unknown ids, notes propagation, empty list),
but the duplicate id and all-unknown id edge cases called out in the issue
were not directly verified. This PR adds that coverage.

Changes

  • Added a test asserting a duplicated id is processed only once — no throw, no
    duplicate entry in history, and the task lands as approved.
  • Added a test asserting an all-unknown id list is a no-op for both
    batchApprove and batchReject (pending queue untouched, history stays empty).

Both tests follow the existing pattern: the store is reset between tests via
useVerifierStore.setState(...) in beforeEach.

Testing

  • npx vitest run src/Zustand/__tests__/Store.test.ts8 tests passing.
  • Store.ts: 100% branch coverage; the verifier batch/single mutators are fully
    covered (the only uncovered lines belong to the unrelated notification store).
  • No changes to production code — tests only, so no regression risk to batch validation.

Notes for reviewer

The core batch tests already exist on main (from an earlier commit), so this is a
small, focused extension covering the two remaining edge cases from the issue.
The diff is limited to src/Zustand/__tests__/Store.test.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for the verifier store batchApprove/batchReject over single mutators

1 participant