<?php

namespace Tests\Feature;

use Tests\TestCase;

class LandingHomeTest extends TestCase
{
    public function test_itro_home_routes_each_business_need_to_the_current_product()
    {
        $response = $this->withServerVariables([
            'HTTP_HOST' => 'itro.vn',
        ])->get('/');

        $response->assertStatus(200);
        $response->assertSee('Hai sản phẩm.');
        $response->assertSee('Một hệ sinh thái.');
        $response->assertSee('/brand/resident-wordmark.svg');
        $response->assertSee('/brand/phongchuan-wordmark.svg');
        $response->assertSee('https://resident.vn/');
        $response->assertSee('https://phongchuan.vn/danh-cho-moi-gioi');
        $response->assertSee('https://phongchuan.vn/tim-phong');
    }

    public function test_itro_home_keeps_a_self_referencing_canonical()
    {
        $response = $this->withServerVariables([
            'HTTP_HOST' => 'itro.vn',
        ])->get('/');

        $response->assertStatus(200);
        $response->assertSee('<link rel="canonical" href="https://itro.vn/">');
    }
}
