From 5247e4dd579d4fdad2a9aef2af1fb12394fcbf04 Mon Sep 17 00:00:00 2001 From: Nano Date: Thu, 4 Jun 2026 06:23:50 -0400 Subject: [PATCH] Add contract/test example to test plan template --- .ai/templates/test-plan.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.ai/templates/test-plan.md b/.ai/templates/test-plan.md index 7b48f20..30b6de4 100644 --- a/.ai/templates/test-plan.md +++ b/.ai/templates/test-plan.md @@ -26,6 +26,27 @@ - [ ] Failure modes are covered. - [ ] Postconditions are observable. +## Example + +Feature: Export a territory + +Contract under test: + +- Preconditions: The territory exists and the user is authorized. +- Inputs: Territory ID. +- Outputs: A downloadable ZIP file. +- Postconditions: The ZIP contains the generated XLSX and PDFs. +- Invariants: The exported files are named consistently. +- Failure modes: Missing territory, file write failure, or export timeout. +- Side effects: Temporary export files may be created and cleaned up after download. + +Test focus: + +- Verify the export is rejected when the territory is missing. +- Verify the ZIP contains both the spreadsheet and the PDFs. +- Verify failed file writes are reported as errors. +- Verify cleanup happens after download. + --- ## Self-Evolution Protocol