From c1d922abd8e07cac2b889c7a63e33ae556aaa936 Mon Sep 17 00:00:00 2001 From: Babissimo Date: Wed, 9 Sep 2026 11:33:00 +0100 Subject: [PATCH] Say why the unconfigured-node assertion cannot pass vacuously Three review notes carried over from #338, none of which justified holding that deploy. The placed node's status test now also asserts the body's shape, matching its REAL_NODE_ID sibling: the two are a deliberate pair and read better making the same claims. The absence assertion is gated on the status. `not.toHaveProperty` holds against an error body as readily as against a correct one, so on a failed request the test would have gone green for the wrong reason. The metrics and trust assertions beside it already caught that, but by accident rather than by saying so, and an absence assertion is exactly the shape that earns an explicit guard. "legacy" leaves the title. POST /api/radar/detections is the current route for a node that registers without a config, not a deprecated one, and the word implied a dead code path a reader would go looking for and not find. Co-Authored-By: Claude Opus 5 --- frontend/e2e/nodes.spec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/e2e/nodes.spec.ts b/frontend/e2e/nodes.spec.ts index 8079ff47..fcecac33 100644 --- a/frontend/e2e/nodes.spec.ts +++ b/frontend/e2e/nodes.spec.ts @@ -572,6 +572,8 @@ describeUnlessProd("Node registration — main integration suite", () => { // would otherwise surface four times as an undefined property rather // than once as the status that actually explains it. expect(placedStatus).toBe(200); + expect(typeof placedBody).toBe("object"); + expect(placedBody).not.toBeNull(); }); test("detection_area block is present with all expected geometry keys", () => { @@ -629,12 +631,17 @@ describeUnlessProd("Node registration — main integration suite", () => { expect((da.furthest_detections as unknown[]).length).toBe(0); }); - test("an unconfigured legacy node is given no detection_area", () => { + test("an unconfigured node is given no detection_area", () => { // The other half of the pair above, and the reason this block reads two // nodes. POST /api/radar/detections registers without coordinates, and // canonical_config leaves them null rather than the (0, 0) it once // coerced them to. No detection area is what keeps such a node off the // map, so its absence here is the contract, not a gap in the payload. + // + // Gated on the status: an absence assertion passes against an error body + // too, so without this the test could go green on a failed request. The + // metrics/trust assertions below would also catch that, but this names it. + expect(analyticsStatus).toBe(200); expect(analyticsBody).not.toHaveProperty("detection_area"); // Still counted and still described: only the footprint is withheld. expect(analyticsBody.metrics).toBeDefined();