47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
meta {
|
|
name: GET skill progression
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
docs {
|
|
NEO-37: per-player read model; join with GET /game/world/skill-definitions for display names.
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/game/players/dev-local-1/skill-progression
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
tests {
|
|
test("returns 200 JSON with schema v1 and skills 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.playerId).to.equal("dev-local-1");
|
|
expect(body.skills).to.be.an("array");
|
|
expect(body.skills.length).to.equal(3);
|
|
});
|
|
|
|
test("skills are ascending by id (ordinal)", function () {
|
|
const body = res.getBody();
|
|
const ids = body.skills.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 trio with default xp and level", function () {
|
|
const body = res.getBody();
|
|
const intrusion = body.skills.find((x) => x.id === "intrusion");
|
|
expect(intrusion).to.be.an("object");
|
|
expect(intrusion.xp).to.equal(0);
|
|
expect(intrusion.level).to.equal(1);
|
|
const ids = new Set(body.skills.map((x) => x.id));
|
|
expect(ids.has("salvage")).to.equal(true);
|
|
expect(ids.has("refine")).to.equal(true);
|
|
expect(ids.has("intrusion")).to.equal(true);
|
|
});
|
|
}
|