test game deserialization relying on round deserialization
This commit is contained in:
parent
1cb03ef70c
commit
5089bef0f7
@ -240,16 +240,13 @@ QUnit.module("models", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test("deserialize - unfinished", function(assert) {
|
QUnit.test("deserialize - unfinished", function(assert) {
|
||||||
|
let currentRound = new Round(2, 3);
|
||||||
|
currentRound.raise(Team.They);
|
||||||
|
|
||||||
let game = new Game({
|
let game = new Game({
|
||||||
goal: 3,
|
goal: 3,
|
||||||
rounds: [{ winner: Team.We, points: 2 }],
|
rounds: [{ winner: Team.We, points: 2 }],
|
||||||
currentRound: {
|
currentRound: currentRound.toJSON(),
|
||||||
points: 3,
|
|
||||||
raisedLast: Team.They,
|
|
||||||
winner: null,
|
|
||||||
weLimit: 2,
|
|
||||||
theyLimit: 3,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.strictEqual(game.goal, 3, "goal");
|
assert.strictEqual(game.goal, 3, "goal");
|
||||||
@ -260,13 +257,7 @@ QUnit.module("models", function() {
|
|||||||
"correct past round");
|
"correct past round");
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
game.currentRound.toJSON(),
|
game.currentRound.toJSON(),
|
||||||
{
|
currentRound.toJSON(),
|
||||||
points: 3,
|
|
||||||
raisedLast: Team.They,
|
|
||||||
winner: null,
|
|
||||||
weLimit: 2,
|
|
||||||
theyLimit: 3,
|
|
||||||
},
|
|
||||||
"correct current round");
|
"correct current round");
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
game.result,
|
game.result,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user