Implement instant websocket room updates

This commit is contained in:
2026-08-25 22:23:38 +02:00
parent bfc93dceba
commit d6e5455e90
18 changed files with 303 additions and 130 deletions
+5 -5
View File
@@ -40,7 +40,7 @@ test('a participant can vote and change their vote in the current round', functi
$this->withSession($session)
->post(route('room.vote.store', $room), ['value' => '5'])
->assertRedirect();
->assertNoContent();
$this->assertDatabaseHas('votes', [
'room_id' => $room->id,
@@ -51,7 +51,7 @@ test('a participant can vote and change their vote in the current round', functi
$this->withSession($session)
->post(route('room.vote.store', $room), ['value' => '8'])
->assertRedirect();
->assertNoContent();
expect(Vote::query()->count())->toBe(1);
expect(Vote::query()->value('value'))->toBe('8')
@@ -91,7 +91,7 @@ test('other votes stay hidden until the moderator reveals the round', function (
$this->withSession($session)
->post(route('room.reveal', $room))
->assertRedirect();
->assertNoContent();
expect($room->fresh()->last_activity_at->greaterThan($previousActivity))->toBeTrue();
@@ -123,7 +123,7 @@ test('starting the next round clears the revealed state', function () {
$this->withSession(["room_players.{$room->id}" => $moderator->id])
->post(route('room.next-round', $room))
->assertRedirect();
->assertNoContent();
$room->refresh();
@@ -156,7 +156,7 @@ test('the moderator can reset only the votes from the current round', function (
$this->withSession(["room_players.{$room->id}" => $moderator->id])
->post(route('room.reset', $room))
->assertRedirect();
->assertNoContent();
$this->assertDatabaseHas('votes', [
'room_id' => $room->id,