test that session update timestamps actually change
This commit is contained in:
parent
78cf050a94
commit
ded78b09e2
@ -134,14 +134,19 @@ export default function() {
|
|||||||
await waitForOpen(inst);
|
await waitForOpen(inst);
|
||||||
|
|
||||||
let session = new Session();
|
let session = new Session();
|
||||||
|
let tsInitial = session.updated;
|
||||||
let id = await SessionRepo.put(session, inst);
|
let id = await SessionRepo.put(session, inst);
|
||||||
assert.strictEqual(session.id, id, "session id has been updated");
|
assert.strictEqual(session.id, id, "session id has been updated");
|
||||||
|
|
||||||
|
// ensure the timestamp is no longer the same
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
||||||
|
|
||||||
session.ourTeam = "This is us!";
|
session.ourTeam = "This is us!";
|
||||||
session.theirTeam = "This is them!";
|
session.theirTeam = "This is them!";
|
||||||
session.goal = 2;
|
session.goal = 2;
|
||||||
session.anotherGame();
|
session.anotherGame();
|
||||||
session.currentGame.currentRound.winner = Team.We;
|
session.currentGame.currentRound.winner = Team.We;
|
||||||
|
assert.true(session.updated > tsInitial, "updated timestamp is higher");
|
||||||
|
|
||||||
// give the change events a chance to execute
|
// give the change events a chance to execute
|
||||||
await new Promise((resolve) => setTimeout(resolve, 10));
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user