allow anyone controll room option

This commit is contained in:
2026-08-27 15:41:21 +02:00
parent b2c1d67283
commit 72152e2d45
16 changed files with 328 additions and 11 deletions
+15 -1
View File
@@ -69,6 +69,12 @@ test('voting and round actions broadcast their state changes', function () {
]);
$session = ["room_players.{$room->id}" => $moderator->id];
$this->withSession($session)
->patch(route('room.permissions.update', $room), [
'allow_participant_controls' => true,
])
->assertNoContent();
$this->withSession($session)
->post(route('room.vote.store', $room), ['value' => '5'])
->assertNoContent();
@@ -94,6 +100,7 @@ test('voting and round actions broadcast their state changes', function () {
RoomStateChange::CardsRevealed,
RoomStateChange::NextRound,
RoomStateChange::VotesReset,
RoomStateChange::PermissionsUpdated,
] as $change) {
Event::assertDispatched(
RoomStateChanged::class,
@@ -130,7 +137,14 @@ test('voting and round actions broadcast their state changes', function () {
},
);
Event::assertDispatchedTimes(RoomStateChanged::class, 5);
Event::assertDispatched(
RoomStateChanged::class,
fn (RoomStateChanged $event): bool => $event->change === RoomStateChange::PermissionsUpdated
&& $event->state !== null
&& $event->state['allow_participant_controls'] === true,
);
Event::assertDispatchedTimes(RoomStateChanged::class, 6);
});
test('failed room actions do not broadcast updates', function () {