<?php

declare(strict_types=1);

namespace Tests\Feature;

use Tests\TestCase;

class AdminPwaAssetsTest extends TestCase
{
    public function test_admin_shell_includes_admin_apple_touch_icon(): void
    {
        $response = $this->get('/event-admin');

        $response->assertOk();
        $response->assertSee('/admin-apple-touch-icon.png', false);
    }

    public function test_admin_manifest_exposes_required_icons(): void
    {
        $manifestPath = public_path('manifest.json');
        $manifest = json_decode(file_get_contents($manifestPath), true, 512, JSON_THROW_ON_ERROR);

        $icons = collect($manifest['icons'] ?? [])->pluck('src')->all();

        $this->assertContains('/admin-icon-192.png', $icons);
        $this->assertContains('/admin-icon-512.png', $icons);
        $this->assertContains('/admin-icon-192-maskable.png', $icons);
        $this->assertContains('/admin-icon-512-maskable.png', $icons);
    }
}
