A seat given a new token loses its address note: whoever used it before has no claim on it by address, and the next use from the new device is noted afresh
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
1 parent
8e9f5fb8ce
commit
85534b983a
2 files changed
+9
-2
No files matched your search
@@ -166,8 +166,13 @@ describe('a seat a browser lost', () => {
|
||||
rooms.seen(room, bo, 'home');
|
||||
const other = rooms.create('Bo', 3);
|
||||
rooms.seen(other.room, other.token, 'home');
|
||||
expect(rooms.findSeats('Bo', 'home', other.room.id).seated.map((s) => s.roomId)).toEqual([other.room.id]);
|
||||
expect(rooms.findSeats('Bo', 'home').seated.map((s) => s.roomId).sort()).toEqual([other.room.id, room.id].sort());
|
||||
const first = rooms.findSeats('Bo', 'home', other.room.id).seated;
|
||||
expect(first.map((s) => s.roomId)).toEqual([other.room.id]);
|
||||
// A seat given back is noted afresh from its next use; until then its old address claims nothing.
|
||||
const second = rooms.findSeats('Bo', 'home').seated;
|
||||
expect(second.map((s) => s.roomId)).toEqual([room.id]);
|
||||
rooms.seen(other.room, first[0].token, 'home');
|
||||
rooms.seen(room, second[0].token, 'home');
|
||||
room.state!.over = { winner: 'A', reason: 'the test says so' };
|
||||
expect(rooms.findSeats('Bo', 'home').seated.map((s) => s.roomId)).toEqual([other.room.id]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user