Fix share assets, shared photo UI, and live show expiry
This commit is contained in:
@@ -15,7 +15,8 @@ class LiveShowDataModelTest extends TestCase
|
||||
|
||||
public function test_event_can_ensure_and_rotate_live_show_token(): void
|
||||
{
|
||||
$event = Event::factory()->create();
|
||||
$eventDate = now()->addDays(1)->startOfDay();
|
||||
$event = Event::factory()->create(['date' => $eventDate]);
|
||||
|
||||
$token = $event->ensureLiveShowToken();
|
||||
|
||||
@@ -23,6 +24,7 @@ class LiveShowDataModelTest extends TestCase
|
||||
$this->assertSame(64, strlen($token));
|
||||
$this->assertSame($token, $event->refresh()->live_show_token);
|
||||
$this->assertNotNull($event->live_show_token_rotated_at);
|
||||
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
|
||||
|
||||
$rotated = $event->rotateLiveShowToken();
|
||||
|
||||
@@ -30,6 +32,24 @@ class LiveShowDataModelTest extends TestCase
|
||||
$this->assertSame(64, strlen($rotated));
|
||||
$this->assertNotSame($token, $rotated);
|
||||
$this->assertSame($rotated, $event->refresh()->live_show_token);
|
||||
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
|
||||
}
|
||||
|
||||
public function test_live_show_token_expiry_updates_when_event_date_changes(): void
|
||||
{
|
||||
$eventDate = now()->addDays(3)->startOfDay();
|
||||
$event = Event::factory()->create(['date' => $eventDate]);
|
||||
|
||||
$event->ensureLiveShowToken();
|
||||
$event->refresh();
|
||||
|
||||
$this->assertSame($eventDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
|
||||
|
||||
$newDate = now()->addDays(7)->startOfDay();
|
||||
$event->update(['date' => $newDate]);
|
||||
|
||||
$event->refresh();
|
||||
$this->assertSame($newDate->copy()->addDay()->endOfDay()->toIso8601String(), $event->live_show_token_expires_at?->toIso8601String());
|
||||
}
|
||||
|
||||
public function test_photo_live_status_is_cast_and_defaults_to_none(): void
|
||||
|
||||
Reference in New Issue
Block a user