Skip to content

Add tests for petition-workspace scripts; fix partial filing on name clash - #1

Open
Selcukatli wants to merge 1 commit into
mainfrom
feature/test-workspace
Open

Selcukatli wants to merge 1 commit into
mainfrom
feature/test-workspace

Conversation

@Selcukatli

Copy link
Copy Markdown
Owner

Summary

  • New test/workspace.test.mjs (17 node:test cases) runs the real scaffold-case.sh and add-evidence.mjs against temp dirs. It covers O-1A/EB-1A criteria counts and names, criterion-7 routing, URL, multi-file, --move and --dry-run rows, and the error paths (invalid criterion, missing -p, formatter-escaped markers, non-empty target).
  • Wired into npm test (test:workspace) and the CI workflow.
  • Bug fix: add-evidence.mjs says it files atomically, but it checked for overwrites inside the copy loop. A clash on file 2 left file 1 filed with no row recorded. It now checks every destination before copying anything.

Verification

  • npm test exits 0 (validate + check-pii + 17/17 workspace tests). The clash test failed before the fix.
  • Manually scaffolded a both case, filed evidence, triggered a clash (exit 2, nothing partially filed, the evidence list unchanged), and built the portal packet.

🤖 Generated with Claude Code

…clash

Adds a node:test suite that runs scaffold-case.sh and add-evidence.mjs
against temp dirs (criteria counts, routing, URL/multi-file/move/dry-run,
validation errors), wired into `npm test` and CI.

add-evidence.mjs checked for existing destinations inside the copy loop,
so a clash on the second file left the first one filed with no row in
evidence-list.md. It now checks every destination before copying any.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant