56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
meta {
|
|
name: POST branch select deny level too low
|
|
type: http
|
|
seq: 3
|
|
}
|
|
|
|
docs {
|
|
NEO-48: salvage tier 1 requires skill level 2. Pre-request resets dev-local-1 via POST …/__dev/mastery-fixture.
|
|
}
|
|
|
|
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 reset = await axios.post(
|
|
`${baseUrl}/game/players/${playerId}/__dev/mastery-fixture`,
|
|
{
|
|
schemaVersion: 1,
|
|
resetPerkState: true,
|
|
skillXp: { salvage: 0 },
|
|
},
|
|
jsonHeaders,
|
|
);
|
|
if (reset.status !== 200 || reset.data?.applied !== true) {
|
|
throw new Error(`mastery fixture reset failed: ${reset.status} ${JSON.stringify(reset.data)}`);
|
|
}
|
|
}
|
|
|
|
post {
|
|
url: {{baseUrl}}/game/players/{{playerId}}/perk-state
|
|
body: json
|
|
auth: none
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"schemaVersion": 1,
|
|
"skillId": "salvage",
|
|
"tierIndex": 1,
|
|
"branchId": "scrap_efficiency"
|
|
}
|
|
}
|
|
|
|
tests {
|
|
test("denies with level_too_low when salvage below gate", function () {
|
|
expect(res.getStatus()).to.equal(200);
|
|
const body = res.getBody();
|
|
expect(body.schemaVersion).to.equal(1);
|
|
expect(body.selected).to.equal(false);
|
|
expect(body.reasonCode).to.equal("level_too_low");
|
|
expect(body.unlockedEvents).to.be.an("array").that.is.empty;
|
|
expect(body.perkState.branchPicks).to.be.an("array").that.is.empty;
|
|
});
|
|
}
|