mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 15:32:09 +00:00
kick forever
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user