fix(canvas/test): ApprovalBanner mockReset to prevent queue stacking #467

Merged
core-be merged 1 commits from fix/approvalbanner-mockreset-452 into main 2026-05-11 11:59:00 +00:00

1 Commits

Author SHA1 Message Date
c2d27d2b3f fix(canvas/test): ApprovalBanner mockReset to prevent queue stacking
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 19s
Harness Replays / detect-changes (pull_request) Successful in 20s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 18s
CI / Detect changes (pull_request) Successful in 1m19s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m18s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m15s
sop-tier-check / tier-check (pull_request) Successful in 18s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 1m14s
CI / Platform (Go) (pull_request) Successful in 7s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 6s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6s
audit-force-merge / audit (pull_request) Successful in 10s
Harness Replays / Harness Replays (pull_request) Failing after 1m16s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7m56s
CI / Canvas (Next.js) (pull_request) Failing after 9m10s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Cherry-picked from PR #452 (fix/canvas-test-and-design-fixes) which
was closed without merge during the PR #443 cascade. The fix adds a
mockPost reference so individual tests can reset the POST mock cleanly
instead of queueing multiple resolved/rejected values.

Without this, the "shows an error toast when POST fails" and "keeps
the card visible when POST fails" tests queue two responses from
beforeEach's mockResolvedValue({}) and the second mockRejectedValueOnce()
call, causing non-deterministic test outcomes.

Fixes test failures in ApprovalBanner suite.
2026-05-11 11:51:21 +00:00