57 lines
1.6 KiB
Plaintext
57 lines
1.6 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 marks operator chain completed via POST …/__dev/quest-fixture (no rep delivery; standing stays 0).
|
|
Success Bruno deferred to NEO-138 when operator-chain rep grants land.
|
|
}
|
|
|
|
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 fixture = await axios.post(
|
|
`${baseUrl}/game/players/${playerId}/__dev/quest-fixture`,
|
|
{
|
|
schemaVersion: 1,
|
|
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);
|
|
});
|
|
}
|