neon-sprawl/bruno/neon-sprawl-server/quest-progress/Accept grid contract factio...

64 lines
2.0 KiB
Plaintext

meta {
name: Accept grid contract faction gate deny
type: http
seq: 10
}
docs {
NEO-137: prototype_quest_grid_contract requires completed operator chain and Grid Operators standing >= 15.
Pre-request resets grid contract progress and prototype faction standing (stale state from prior seq 11 runs), then marks operator chain completed via POST …/__dev/quest-fixture (no rep delivery; standing 0).
Success sibling: seq 11 Accept grid contract after operator chain (NEO-138 organic rep grant).
}
script:pre-request {
const axios = require("axios");
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
const playerId = bru.getEnvVar("playerId") || bru.getVar("playerId");
const jsonHeaders = { headers: { "Content-Type": "application/json" } };
const chainQuestId = "prototype_quest_operator_chain";
const gridContractQuestId = "prototype_quest_grid_contract";
const prototypeFactionIds = [
"prototype_faction_grid_operators",
"prototype_faction_rust_collective",
];
const fixture = await axios.post(
`${baseUrl}/game/players/${playerId}/__dev/quest-fixture`,
{
schemaVersion: 1,
resetQuestIds: [gridContractQuestId],
resetFactionIds: prototypeFactionIds,
completedQuestIds: [chainQuestId],
},
{ ...jsonHeaders, validateStatus: () => true },
);
if (fixture.status !== 200 || fixture.data?.applied !== true) {
throw new Error(
`quest-fixture failed: HTTP ${fixture.status} ${JSON.stringify(fixture.data)}`,
);
}
}
post {
url: {{baseUrl}}/game/players/{{playerId}}/quests/prototype_quest_grid_contract/accept
body: json
auth: none
}
body:json {
{
"schemaVersion": 1
}
}
tests {
test("denies accept with faction_gate_blocked when standing below minStanding", function () {
expect(res.getStatus()).to.equal(200);
const body = res.getBody();
expect(body.schemaVersion).to.equal(1);
expect(body.accepted).to.equal(false);
expect(body.reasonCode).to.equal("faction_gate_blocked");
expect(body.quest).to.equal(undefined);
});
}