test: close the empty-array hole in the e2e unstubbed-request guard (closes #187)
All checks were successful
check / check (push) Successful in 42s
All checks were successful
check / check (push) Successful in 42s
batch.every() is vacuously true on an empty array, so a POST with body []
was fulfilled with 200 [] instead of being reported as an unstubbed
request. The one mechanism whose job is to fail the suite on unrecognised
outbound traffic let it through. Reject an empty batch explicitly; no real
JSON-RPC batch is empty, so nothing legitimate is caught by it.
Demonstrated by execution with a throwaway probe firing four POSTs the
harness does not stub. Before: [] fulfilled and its probe passed, while
the bodyless, scalar-JSON and [null] probes were reported and failed.
After: all four reported and failed, with tests 1-27 still green.
Also corrects the comment above the guard. postData() is
buffer.toString("utf-8") || null in playwright-core, so a binary body is
decoded lossily into invalid JSON and reported by the catch, not returned
as null; only an absent or empty body yields null and reaches the type
guard. Both paths report, but the stated reason was wrong.
This commit is contained in:
8
TODO.md
8
TODO.md
@@ -44,6 +44,14 @@ undefined identifiers, which is how
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-08-12: Closed the empty-array hole in the end-to-end unstubbed-request
|
||||
guard. `batch.every()` is vacuously true on `[]`, so a POST with body `[]` was
|
||||
answered `200 []` instead of failing the suite; the guard now rejects an empty
|
||||
batch, demonstrated green-before/red-after with a throwaway probe. The comment
|
||||
claiming `postData()` returns `null` for undecodable bodies was corrected to
|
||||
the two real paths — an absent or empty body decodes to `null`, a binary body
|
||||
decodes lossily into invalid JSON
|
||||
([#187](https://git.eeqj.de/sneak/AutistMask/issues/187)).
|
||||
- 2026-08-12: The transaction confirmation screen has browser coverage. The
|
||||
end-to-end suite reaches ConfirmTx for both the native ETH and the ERC-20 path
|
||||
off a funded-balance fixture, and asserts the pending, funded, over-balance
|
||||
|
||||
Reference in New Issue
Block a user