<?php

declare(strict_types=1);

namespace Tests\Feature\Admin;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Testing\Fluent\AssertableJson;
use Inertia\Testing\AssertableInertia;
use Tests\TestCase;

final class ModerationDailyActivityPageTest extends TestCase
{
    use RefreshDatabase;

    public function test_admin_can_open_daily_activity_page_with_selected_date(): void
    {
        $admin = User::factory()->create([
            'role' => 'admin',
        ]);

        $this->actingAs($admin)
            ->get('/moderation/activity?date=2026-04-29')
            ->assertOk()
            ->assertInertia(fn (AssertableInertia $page) => $page
                ->component('Admin/DailyActivity')
                ->where('selectedDate', '2026-04-29')
                ->where('summary.new_users', 0)
                ->where('queues.pending_uploads', 0)
                ->has('sections.users')
                ->has('sections.artworks')
                ->has('sections.stories')
                ->has('sections.uploads')
                ->has('sections.reports')
                ->has('sections.username_requests')
                ->has('sections.auth_events'));
    }
}