neon-sprawl/bruno/neon-sprawl-server/faction-standing/Get faction standing defaul...

33 lines
1.2 KiB
Plaintext

meta {
name: GET faction standing default
type: http
seq: 2
}
docs {
NEO-139: per-player standing snapshot for all catalog factions.
Fresh in-memory server (or reset standing) returns neutral 0 for both prototype factions.
Postgres may retain prior standing until reset — restart server or clear player_faction_standing for dev-local-1.
}
get {
url: {{baseUrl}}/game/players/{{playerId}}/faction-standing
body: none
auth: none
}
tests {
test("returns 200 JSON with schema v1 and two prototype factions at neutral standing", 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.playerId).to.equal(bru.getEnvVar("playerId") || bru.getVar("playerId") || "dev-local-1");
expect(body.factions).to.be.an("array");
expect(body.factions.length).to.equal(2);
const byId = Object.fromEntries(body.factions.map((row) => [row.id, row.standing]));
expect(byId["prototype_faction_grid_operators"]).to.equal(0);
expect(byId["prototype_faction_rust_collective"]).to.equal(0);
});
}