From ded78b09e2d1358a7ae6012f89c26bdd82c47740 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Fri, 27 Feb 2026 22:53:32 +0100 Subject: [PATCH] test that session update timestamps actually change --- data/session_repo.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/session_repo.test.js b/data/session_repo.test.js index 6c3dbb4..2ff98ef 100644 --- a/data/session_repo.test.js +++ b/data/session_repo.test.js @@ -134,14 +134,19 @@ export default function() { await waitForOpen(inst); let session = new Session(); + let tsInitial = session.updated; let id = await SessionRepo.put(session, inst); 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.theirTeam = "This is them!"; session.goal = 2; session.anotherGame(); session.currentGame.currentRound.winner = Team.We; + assert.true(session.updated > tsInitial, "updated timestamp is higher"); // give the change events a chance to execute await new Promise((resolve) => setTimeout(resolve, 10));