|
|
|
@ -131,4 +131,33 @@ describe("chase stage skeleton", () => { |
|
|
|
expect(newRound.mock.calls[0][1]).toBe("easy"); |
|
|
|
expect(newRound.mock.calls[1][1]).toBe("easy"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("uses normal as default difficulty", () => { |
|
|
|
const newRound = vi.fn(); |
|
|
|
const getState = vi.fn().mockReturnValue({ |
|
|
|
turn: 0, |
|
|
|
snapshot: { |
|
|
|
status: "playing", |
|
|
|
thiefNodeId: "A", |
|
|
|
guardNodeId: "B", |
|
|
|
exitNodeId: "B", |
|
|
|
graph: { |
|
|
|
nodes: { |
|
|
|
A: { id: "A", q: 0, r: 0, neighbors: ["B"] }, |
|
|
|
B: { id: "B", q: 1, r: 0, neighbors: ["A"] }, |
|
|
|
}, |
|
|
|
edgeList: [["A", "B"]], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const scene = new ChaseScene({ |
|
|
|
model: { getState, moveThief: vi.fn(), newRound } as any, |
|
|
|
}); |
|
|
|
(scene as any).hudText = new Text({ text: "" }); |
|
|
|
(scene as any).setupText = new Text({ text: "" }); |
|
|
|
(scene as any).setSeedInput("1001"); |
|
|
|
|
|
|
|
(scene as any).startGame(); |
|
|
|
expect(newRound).toHaveBeenCalledWith(1001, "normal"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|