mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-15 07:06:09 +00:00
allow anyone controll room option
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user