Update guest PWA v2 UI and likes
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-05 15:09:19 +01:00
parent 6eafec2128
commit fa630e335d
22 changed files with 1288 additions and 200 deletions

View File

@@ -368,6 +368,38 @@ class GuestJoinTokenFlowTest extends TestCase
$this->assertEquals(1, $photo->fresh()->likes_count);
}
public function test_guest_can_unlike_photo_after_liking(): void
{
$event = $this->createPublishedEvent();
$token = $this->tokenService->createToken($event);
$photo = Photo::factory()->create([
'event_id' => $event->id,
'likes_count' => 0,
]);
$this->getJson("/api/v1/events/{$token->token}");
$this->withHeader('X-Device-Id', 'device-like')
->postJson("/api/v1/photos/{$photo->id}/like")
->assertOk();
$response = $this->withHeader('X-Device-Id', 'device-like')
->deleteJson("/api/v1/photos/{$photo->id}/like");
$response->assertOk()
->assertJson([
'liked' => false,
]);
$this->assertDatabaseMissing('photo_likes', [
'photo_id' => $photo->id,
'guest_name' => 'device-like',
]);
$this->assertEquals(0, $photo->fresh()->likes_count);
}
public function test_guest_cannot_access_event_with_expired_token(): void
{
$event = $this->createPublishedEvent();