Add retain keyword to endTurn

This commit is contained in:
Jared Miller 2026-02-25 09:22:19 -05:00
parent 8a6a2f7662
commit 62a1ef051c
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -353,6 +353,22 @@ describe("endTurn - ethereal", () => {
}); });
}); });
describe("endTurn - retain", () => {
test("retained cards stay in hand at end of turn", () => {
let state = createCombatState("ironclad", "jaw_worm");
const player = {
...state.player,
hand: ["strike_r", "equilibrium", "defend_r"],
};
state = { ...state, player, players: [player] };
const next = endTurn(state);
expect(next.player.hand).toContain("equilibrium");
expect(next.player.discardPile).toContain("strike_r");
expect(next.player.discardPile).toContain("defend_r");
expect(next.player.hand).toHaveLength(1);
});
});
describe("playCard - unplayable", () => { describe("playCard - unplayable", () => {
test("unplayable card cannot be played", () => { test("unplayable card cannot be played", () => {
let state = createCombatState("ironclad", "jaw_worm"); let state = createCombatState("ironclad", "jaw_worm");