kick forever
CI/CD / test_and_check_app (push) Successful in 2m19s
CI/CD / Publish immutable image (push) Successful in 1m16s

This commit is contained in:
2026-09-24 14:38:18 +02:00
parent b190ff719e
commit 4dfe79ce5c
22 changed files with 271 additions and 113 deletions
+5 -4
View File
@@ -216,15 +216,16 @@ test('an active guest with a room session skips the join form', function () {
->assertRedirect(route('room.show', $room));
});
test('an inactive guest is sent through join and reuses the existing player', function () {
test('a removed guest joins again with a new player identity', function () {
$room = createLifecycleRoom();
$player = $room->players()->create([
'name' => 'Returning guest',
'last_seen_at' => now()->subHours(2),
'inactive_at' => now()->subHour(),
]);
$session = ["room_players.{$room->id}" => $player->id];
$player->delete();
$this->withSession($session)
->get(route('room.show', $room))
->assertRedirect(route('room.join', ['join_code' => $room->join_code]));
@@ -233,7 +234,7 @@ test('an inactive guest is sent through join and reuses the existing player', fu
->get(route('room.join', ['join_code' => $room->join_code]))
->assertInertia(fn (Assert $page) => $page
->component('rooms/Join')
->where('defaultPlayerName', 'Returning guest'));
->where('defaultPlayerName', null));
$this->withSession($session)
->post(route('room.code'), [
@@ -243,7 +244,7 @@ test('an inactive guest is sent through join and reuses the existing player', fu
->assertRedirect(route('room.show', $room));
expect($room->players()->count())->toBe(1)
->and($player->fresh()->inactive_at)->toBeNull();
->and($room->players()->sole()->id)->not->toBe($player->id);
});
test('showing or polling a room does not count as room activity', function () {