<?php

use App\Filament\Pages\Dashboard;
use App\Models\User;
use Livewire\Livewire;

beforeEach(function () {
    $this->actingAs(User::factory()->create());
});

it('renders the dashboard page', function () {
    Livewire::test(Dashboard::class)
        ->assertSuccessful();
});

it('displays the project title and description', function () {
    Livewire::test(Dashboard::class)
        ->assertSee('Bienvenue sur API Logistics')
        ->assertSee('Flex/ESI Gescom');
});

it('shows navigation links to all pages', function () {
    Livewire::test(Dashboard::class)
        ->assertSee('Tables')
        ->assertSee('Articles')
        ->assertSee('Documents')
        ->assertSee('Journaux')
        ->assertSee('Tiers')
        ->assertSee('Documentation');
});

it('displays project statistics', function () {
    Livewire::test(Dashboard::class)
        ->assertSee('Endpoints API')
        ->assertSee('Tables accessibles')
        ->assertSee('Pages Filament')
        ->assertSee('Tests Pest');
});

it('shows technical information', function () {
    Livewire::test(Dashboard::class)
        ->assertSee('Informations techniques')
        ->assertSee('Laravel 12')
        ->assertSee('Filament 5')
        ->assertSee('Livewire 4');
});
