Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/games/lielow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ export class LielowGame extends GameBase {
const suicideMoves = this.movesUntilSuicide();
return [
{ name: this.neutralAreaLabel("apgames:status.PIECESREMAINING"), scores: [this.getPlayerPieces(1), this.getPlayerPieces(2)] },
{ name: this.neutralAreaLabel("apgames:status.lielow.MOVESUNTILSUICIDE"), scores: [suicideMoves[0], suicideMoves[1]] }
{ name: this.neutralAreaLabel("apgames:status.lielow.MOVESUNTILSUICIDE"), scores: [suicideMoves[0], suicideMoves[1]], spoiler: true }
]
}

Expand Down
27 changes: 27 additions & 0 deletions test/games/lielow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */
import "mocha";
import { expect } from "chai";
import { LielowGame } from "../../src/games/lielow";
import { isStructuredRenderLabel } from "../../src/common/render-label";

function textKey(label: unknown): string | undefined {
return isStructuredRenderLabel(label) ? label.textKey : undefined;
}

describe("Lielow", () => {
describe("sidebarScores", () => {
it("marks moves until suicide as a spoiler but leaves pieces remaining visible", () => {
const g = new LielowGame();
const scores = g.sidebarScores();
expect(scores).to.have.lengthOf(2);

const pieces = scores.find((s) => textKey(s.name) === "apgames:status.PIECESREMAINING");
expect(pieces).to.not.be.undefined;
expect(pieces!.spoiler).to.not.equal(true);

const suicide = scores.find((s) => textKey(s.name) === "apgames:status.lielow.MOVESUNTILSUICIDE");
expect(suicide).to.not.be.undefined;
expect(suicide!.spoiler).to.be.true;
});
});
});
Loading