test: cover superseded socket handshake

This commit is contained in:
lda
2026-07-14 12:41:02 +07:00 Verified
parent 783134d5ef
commit a79fe8b362
@@ -189,14 +189,15 @@ describe("presentation synchronization routes", () => {
const oldClose = once(oldPresenter, "close"); const oldClose = once(oldPresenter, "close");
const replacement = await trackedConnect(origin, presenterGrant.connectionToken); const replacement = await trackedConnect(origin, presenterGrant.connectionToken);
expect((await oldClose)[0]).toBe(4001);
oldPresenter.send(JSON.stringify({ oldPresenter.send(JSON.stringify({
type: "location.publish", type: "location.publish",
hash: "#scene/old-must-not-win", hash: "#scene/old-must-not-win",
baseRevision: 0, baseRevision: 0,
messageId: "old-publish", messageId: "old-publish",
})); }));
oldPresenter.send(JSON.stringify({ type: "ping", nonce: "old-ping" }));
oldPresenter.send(JSON.stringify({ type: "session.end" })); oldPresenter.send(JSON.stringify({ type: "session.end" }));
expect((await oldClose)[0]).toBe(4001);
replacement.send(JSON.stringify({ replacement.send(JSON.stringify({
type: "location.publish", type: "location.publish",