<?php

namespace Tests\Feature;

use App\Support\InstallationState;
use Tests\TestCase;

class HomepageTest extends TestCase
{
    public function test_homepage_redirects_to_installer_when_not_installed(): void
    {
        $this->get(route('home'))
            ->assertRedirect(route('installer.welcome'));
    }

    public function test_homepage_renders_when_installed(): void
    {
        app(InstallationState::class)->markInstalled();

        $this->get(route('home'))
            ->assertOk()
            ->assertSee('Admin Login', false)
            ->assertSee('Why choose us', false)
            ->assertSee('home-hero-showcase', false)
            ->assertSee('assets/css/homepage.css', false);
    }
}
