From 432cc4106b1fa96d6118449592d7af595bcabb1b Mon Sep 17 00:00:00 2001 From: VinPropane Date: Fri, 24 Apr 2026 21:08:23 -0400 Subject: [PATCH] chore: Bruno tests for GET /game/world/interactables --- .../interaction/Get interactables list.bru | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/bruno/neon-sprawl-server/interaction/Get interactables list.bru b/bruno/neon-sprawl-server/interaction/Get interactables list.bru index 6ba0276..b3ee983 100644 --- a/bruno/neon-sprawl-server/interaction/Get interactables list.bru +++ b/bruno/neon-sprawl-server/interaction/Get interactables list.bru @@ -9,3 +9,47 @@ get { body: none auth: none } + +tests { + test("returns 200 JSON with schema v1 and interactables array", function () { + expect(res.getStatus()).to.equal(200); + expect(res.getHeader("content-type")).to.contain("application/json"); + const body = res.getBody(); + expect(body.schemaVersion).to.equal(1); + expect(body.interactables).to.be.an("array"); + expect(body.interactables.length).to.be.at.least(2); + }); + + test("interactables are ascending by interactableId", function () { + const body = res.getBody(); + const ids = body.interactables.map((x) => x.interactableId); + const sorted = [...ids].sort((a, b) => a.localeCompare(b)); + expect(ids).to.eql(sorted); + }); + + test("prototype_resource_node_alpha row matches registry", function () { + const body = res.getBody(); + const row = body.interactables.find( + (x) => x.interactableId === "prototype_resource_node_alpha" + ); + expect(row).to.be.an("object"); + expect(row.kind).to.equal("resource_node"); + expect(row.anchor.x).to.equal(12); + expect(row.anchor.y).to.equal(0.5); + expect(row.anchor.z).to.equal(-6); + expect(row.interactionRadius).to.equal(3); + }); + + test("prototype_terminal row matches registry", function () { + const body = res.getBody(); + const row = body.interactables.find( + (x) => x.interactableId === "prototype_terminal" + ); + expect(row).to.be.an("object"); + expect(row.kind).to.equal("terminal"); + expect(row.anchor.x).to.equal(0); + expect(row.anchor.y).to.equal(0.5); + expect(row.anchor.z).to.equal(0); + expect(row.interactionRadius).to.equal(3); + }); +}