📌 Description
AnchorDetail.test.tsx has a test, "confirms before deactivating the anchor", that opens the ConfirmDialog and clicks its confirm button, asserting deregisterAnchor is called. SettlementDetail.test.tsx has the equivalent "confirms before cancelling a pending settlement" test for cancelSettlement. Neither test file has any test for the opposite path — a user opening the confirm dialog and then backing out (clicking Cancel, the backdrop, or pressing Escape) without confirming. ConfirmDialog itself is thoroughly unit-tested for this cancel behavior in isolation (ConfirmDialog.test.tsx), but nothing currently verifies the integration wiring in AnchorDetail/SettlementDetail — that their onCancel handlers correctly just close the dialog without invoking deregisterAnchor/cancelSettlement. A future refactor that accidentally wired onCancel to the destructive action (or removed the distinction between the two callbacks) would go completely undetected by either component's current test suite.
🧩 Requirements and context
- Add a test to
AnchorDetail.test.tsx that opens the deactivate confirm dialog, cancels it, and asserts deregisterAnchor was never called and the anchor's status is unchanged.
- Add a test to
SettlementDetail.test.tsx that opens the cancel-settlement confirm dialog, cancels it, and asserts cancelSettlement was never called and the settlement's status is unchanged.
- No production code changes are expected; this is purely closing an integration-level test-coverage gap on already-shipped confirm/cancel wiring.
🛠️ Suggested execution
- In
src/components/AnchorDetail.test.tsx, render AnchorDetail with an active anchor, click "Deactivate" to open the dialog, click the dialog's "Cancel" button, and assert deregisterAnchor was not called and the anchor still renders as "Active".
- In
src/components/SettlementDetail.test.tsx, render SettlementDetail with a pending settlement, click "Cancel" to open the dialog, click "Keep settlement", and assert cancelSettlement was not called and the settlement still renders as "Pending".
✅ Acceptance criteria
🔒 Security notes
No new attack surface; a test-coverage task on already-shipped confirm/cancel logic.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
AnchorDetail.test.tsxhas a test, "confirms before deactivating the anchor", that opens theConfirmDialogand clicks its confirm button, assertingderegisterAnchoris called.SettlementDetail.test.tsxhas the equivalent "confirms before cancelling a pending settlement" test forcancelSettlement. Neither test file has any test for the opposite path — a user opening the confirm dialog and then backing out (clicking Cancel, the backdrop, or pressing Escape) without confirming.ConfirmDialogitself is thoroughly unit-tested for this cancel behavior in isolation (ConfirmDialog.test.tsx), but nothing currently verifies the integration wiring inAnchorDetail/SettlementDetail— that theironCancelhandlers correctly just close the dialog without invokingderegisterAnchor/cancelSettlement. A future refactor that accidentally wiredonCancelto the destructive action (or removed the distinction between the two callbacks) would go completely undetected by either component's current test suite.🧩 Requirements and context
AnchorDetail.test.tsxthat opens the deactivate confirm dialog, cancels it, and assertsderegisterAnchorwas never called and the anchor's status is unchanged.SettlementDetail.test.tsxthat opens the cancel-settlement confirm dialog, cancels it, and assertscancelSettlementwas never called and the settlement's status is unchanged.🛠️ Suggested execution
src/components/AnchorDetail.test.tsx, renderAnchorDetailwith an active anchor, click "Deactivate" to open the dialog, click the dialog's "Cancel" button, and assertderegisterAnchorwas not called and the anchor still renders as "Active".src/components/SettlementDetail.test.tsx, renderSettlementDetailwith a pending settlement, click "Cancel" to open the dialog, click "Keep settlement", and assertcancelSettlementwas not called and the settlement still renders as "Pending".✅ Acceptance criteria
🔒 Security notes
No new attack surface; a test-coverage task on already-shipped confirm/cancel logic.
📋 Guidelines