From 5089bef0f7d1b22856c2d81f61e17e56dedc930b Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Mon, 9 Feb 2026 20:13:21 +0100 Subject: [PATCH] test game deserialization relying on round deserialization --- models/game.test.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/models/game.test.js b/models/game.test.js index f1a29e6..392d79c 100644 --- a/models/game.test.js +++ b/models/game.test.js @@ -240,16 +240,13 @@ QUnit.module("models", function() { }); QUnit.test("deserialize - unfinished", function(assert) { + let currentRound = new Round(2, 3); + currentRound.raise(Team.They); + let game = new Game({ goal: 3, rounds: [{ winner: Team.We, points: 2 }], - currentRound: { - points: 3, - raisedLast: Team.They, - winner: null, - weLimit: 2, - theyLimit: 3, - }, + currentRound: currentRound.toJSON(), }); assert.strictEqual(game.goal, 3, "goal"); @@ -260,13 +257,7 @@ QUnit.module("models", function() { "correct past round"); assert.deepEqual( game.currentRound.toJSON(), - { - points: 3, - raisedLast: Team.They, - winner: null, - weLimit: 2, - theyLimit: 3, - }, + currentRound.toJSON(), "correct current round"); assert.deepEqual( game.result,