<?php

namespace Tests\Feature;

use Tests\TestCase;

class SitePagesTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();

        config()->set('dewemoji.data_path', base_path('tests/Fixtures/emojis.fixture.json'));
    }

    public function test_core_pages_are_available(): void
    {
        $this->get('/')->assertOk();
        $this->get('/browse')->assertOk();
        $this->get('/animals')->assertOk();
        $this->get('/animals/animal-mammal')->assertOk();
        $this->get('/api-docs')->assertOk();
        $this->get('/pricing')->assertOk();
        $this->get('/support')->assertOk();
        $this->get('/privacy')->assertOk();
        $this->get('/terms')->assertOk();
        $this->get('/robots.txt')->assertOk();
        $this->get('/sitemap.xml')->assertOk();
    }

    public function test_emoji_detail_page_works_with_valid_slug(): void
    {
        $this->get('/emoji/grinning-face')
            ->assertOk()
            ->assertSee('grinning face');
    }

    public function test_emoji_detail_page_returns_404_for_unknown_slug(): void
    {
        $this->get('/emoji/unknown-slug')->assertNotFound();
    }
}
