create([ 'status' => 'published', ]); $token = app(EventJoinTokenService::class) ->createToken($event, ['label' => 'guest']) ->plain_token; $pendingMine = Photo::factory()->for($event)->create([ 'status' => 'pending', 'created_by_device_id' => 'device-123', ]); Photo::factory()->for($event)->create([ 'status' => 'pending', 'created_by_device_id' => 'device-999', ]); Photo::factory()->for($event)->create([ 'status' => 'approved', 'created_by_device_id' => 'device-123', ]); $response = $this->withHeaders(['X-Device-Id' => 'device-123']) ->getJson("/api/v1/events/{$token}/pending-photos"); $response->assertOk(); $response->assertJsonCount(1, 'data'); $response->assertJsonFragment([ 'id' => $pendingMine->id, 'status' => 'pending', ]); $response->assertJson(['meta' => ['total_count' => 1]]); $this->assertNotEmpty($response->json('data.0.thumbnail_url')); } public function test_pending_uploads_returns_empty_without_device_id(): void { $event = Event::factory()->create([ 'status' => 'published', ]); $token = app(EventJoinTokenService::class) ->createToken($event, ['label' => 'guest']) ->plain_token; Photo::factory()->for($event)->create([ 'status' => 'pending', 'created_by_device_id' => 'device-123', ]); $response = $this->getJson("/api/v1/events/{$token}/pending-photos"); $response->assertOk(); $response->assertJson(['data' => [], 'meta' => ['total_count' => 0]]); } }