neon-sprawl/bruno/neon-sprawl-server/craft/Post craft deny invalid qua...

43 lines
831 B
Plaintext

meta {
name: POST craft deny invalid quantity
type: http
seq: 4
}
docs {
NEO-70: non-positive quantity denies with invalid_quantity.
}
script:pre-request {
const { ensureItemQuantity } = require("./scripts/inventory-api-helper.js");
await ensureItemQuantity(bru, "scrap_metal_bulk", 5);
}
post {
url: {{baseUrl}}/game/players/{{playerId}}/craft
body: json
auth: none
}
headers {
content-type: application/json
}
body:json {
{
"schemaVersion": 1,
"recipeId": "refine_scrap_standard",
"quantity": 0
}
}
tests {
test("denies with invalid_quantity", function () {
expect(res.getStatus()).to.equal(200);
const body = res.getBody();
expect(body.schemaVersion).to.equal(1);
expect(body.success).to.equal(false);
expect(body.reasonCode).to.equal("invalid_quantity");
});
}