mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-14 22:15:28 +00:00
Handle authenticated room instance takeover
This commit is contained in:
@@ -45,6 +45,25 @@ test('room state broadcasts synchronously expose sanitized state', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('player instance replacement broadcasts the displaced instance', function () {
|
||||
$event = new RoomStateChanged(
|
||||
'019b8f80-37c4-71a3-b415-5f2697332c16',
|
||||
8,
|
||||
RoomStateChange::PlayerInstanceReplaced,
|
||||
null,
|
||||
42,
|
||||
'019b8f80-37c4-71a3-b415-5f2697332c17',
|
||||
);
|
||||
|
||||
expect($event->broadcastWith())->toBe([
|
||||
'version' => 8,
|
||||
'change' => 'player_instance_replaced',
|
||||
'state' => null,
|
||||
'affected_player_id' => 42,
|
||||
'affected_instance_id' => '019b8f80-37c4-71a3-b415-5f2697332c17',
|
||||
]);
|
||||
});
|
||||
|
||||
test('joining a room broadcasts the new room version', function () {
|
||||
Event::fake([RoomStateChanged::class]);
|
||||
$room = createBroadcastRoom();
|
||||
|
||||
Reference in New Issue
Block a user