diff --git a/src/games/lielow.ts b/src/games/lielow.ts index 76a780a1..8e6e2d3a 100644 --- a/src/games/lielow.ts +++ b/src/games/lielow.ts @@ -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 } ] } diff --git a/test/games/lielow.test.ts b/test/games/lielow.test.ts new file mode 100644 index 00000000..4a5cabde --- /dev/null +++ b/test/games/lielow.test.ts @@ -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; + }); + }); +});