neon-sprawl/bruno/neon-sprawl-server/npc-behavior-definitions/Get npc behavior definition...

68 lines
2.3 KiB
Plaintext

meta {
name: GET npc behavior definitions
type: http
seq: 1
}
get {
url: {{baseUrl}}/game/world/npc-behavior-definitions
body: none
auth: none
}
tests {
test("returns 200 JSON with schema v1 and npcBehaviors array", function () {
expect(res.getStatus()).to.equal(200);
expect(res.getHeader("content-type")).to.contain("application/json");
const body = res.getBody();
expect(body.schemaVersion).to.equal(1);
expect(body.npcBehaviors).to.be.an("array");
expect(body.npcBehaviors.length).to.equal(3);
});
test("npcBehaviors are ascending by id (ordinal)", function () {
const body = res.getBody();
const ids = body.npcBehaviors.map((x) => x.id);
const sorted = [...ids].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
expect(ids).to.eql(sorted);
});
test("frozen prototype three matches registry id order", function () {
const body = res.getBody();
const ids = body.npcBehaviors.map((x) => x.id);
expect(ids).to.eql([
"prototype_elite_mini_boss",
"prototype_melee_pressure",
"prototype_ranged_control",
]);
});
test("prototype_melee_pressure row matches catalog", function () {
const body = res.getBody();
const row = body.npcBehaviors.find((x) => x.id === "prototype_melee_pressure");
expect(row).to.be.an("object");
expect(row.displayName).to.equal("Melee Pressure");
expect(row.archetypeKind).to.equal("melee_pressure");
expect(row.maxHp).to.equal(100);
expect(row.aggroRadius).to.equal(8);
expect(row.leashRadius).to.equal(16);
expect(row.telegraphWindupSeconds).to.equal(1.5);
expect(row.attackDamage).to.equal(15);
expect(row.attackCooldownSeconds).to.equal(3);
});
test("prototype_elite_mini_boss row matches catalog", function () {
const body = res.getBody();
const row = body.npcBehaviors.find((x) => x.id === "prototype_elite_mini_boss");
expect(row).to.be.an("object");
expect(row.displayName).to.equal("Elite Mini-Boss");
expect(row.archetypeKind).to.equal("elite_mini_boss");
expect(row.maxHp).to.equal(200);
expect(row.aggroRadius).to.equal(8);
expect(row.leashRadius).to.equal(18);
expect(row.telegraphWindupSeconds).to.equal(2.5);
expect(row.attackDamage).to.equal(25);
expect(row.attackCooldownSeconds).to.equal(5);
});
}