<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class ComingSoonTest extends TestCase
{
    use RefreshDatabase;

    protected function setUp(): void
    {
        parent::setUp();
        // Enable COMING_SOON config dynamically for testing
        config(['app.coming_soon' => true]);
    }

    public function test_homepage_redirects_to_coming_soon(): void
    {
        $response = $this->get('/');
        $response->assertRedirect('/coming-soon');
    }

    public function test_coming_soon_page_renders(): void
    {
        $response = $this->get('/coming-soon');
        $response->assertOk()
            ->assertSee('Something')
            ->assertSee('WE ARE LAUNCHING SOON');
    }

    public function test_direct_feedback_link_works(): void
    {
        $response = $this->get('/feedback');
        $response->assertOk()
            ->assertSee('How did we do?')
            ->assertSee('Training Feedback');
    }

    public function test_direct_admin_link_works(): void
    {
        $response = $this->get('/admin');
        $response->assertRedirect();
        
        // Assert it does not redirect to coming-soon
        $this->assertStringNotContainsString('coming-soon', $response->headers->get('Location'));
    }
}
