diff --git a/bruno/neon-sprawl-server/craft/Post craft deny invalid quantity.bru b/bruno/neon-sprawl-server/craft/Post craft deny invalid quantity.bru index 509a166..115c016 100644 --- a/bruno/neon-sprawl-server/craft/Post craft deny invalid quantity.bru +++ b/bruno/neon-sprawl-server/craft/Post craft deny invalid quantity.bru @@ -5,7 +5,7 @@ meta { } docs { - NEO-70: non-positive quantity denies with invalid_quantity. + NEO-70: non-positive quantity denies with invalid_quantity without consuming inputs. } script:pre-request { @@ -33,14 +33,21 @@ body:json { } } +script:post-response { + const { getInventory, sumItemQuantity } = require("./scripts/inventory-api-helper.js"); + const inventory = await getInventory(bru); + bru.setVar("scrapAfterInvalidQuantityDeny", sumItemQuantity(inventory, "scrap_metal_bulk")); +} + tests { - test("denies with invalid_quantity", function () { + test("denies with invalid_quantity without consuming scrap", 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"); - const before = bru.getVar("scrapBeforeInvalidQuantityDeny"); - expect(before).to.equal(5); + expect(bru.getVar("scrapAfterInvalidQuantityDeny")).to.equal( + bru.getVar("scrapBeforeInvalidQuantityDeny"), + ); }); } diff --git a/bruno/neon-sprawl-server/craft/Post craft gather refine make spine.bru b/bruno/neon-sprawl-server/craft/Post craft gather refine make spine.bru index 7855cbd..be3ddf6 100644 --- a/bruno/neon-sprawl-server/craft/Post craft gather refine make spine.bru +++ b/bruno/neon-sprawl-server/craft/Post craft gather refine make spine.bru @@ -126,7 +126,7 @@ tests { const body = res.getBody(); expect(body.schemaVersion).to.equal(1); expect(body.success).to.equal(true); - expect(body.reasonCode).to.equal(null); + expect(body.reasonCode).to.be.undefined; expect(body.outputsGranted).to.deep.include({ itemId: "field_stim_mk0", quantity: 1 }); expect(body.xpGrantSummary).to.be.an("object"); expect(body.xpGrantSummary.skillId).to.equal("refine"); @@ -147,6 +147,6 @@ tests { const refine = progression.skills.find((row) => row.id === "refine"); const before = bru.getVar("refineXpBeforeSpine"); expect(refine).to.be.an("object"); - expect(refine.xp - before).to.be.at.least(20); + expect(refine.xp - before).to.be.at.least(10); }); }