Co-authored-by: manoel freitas <manoel.josefneto@gmail.com> Co-committed-by: manoel freitas <manoel.josefneto@gmail.com>
62 lines
2.1 KiB
PHP
62 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Feature\PublicSite;
|
|
|
|
use App\Models\SiteSetting;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Tests\TestCase;
|
|
|
|
class PublicLayoutSeoTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_public_layout_emits_seo_head_landmarks_and_site_settings_chrome(): void
|
|
{
|
|
Storage::fake('public');
|
|
|
|
$settings = SiteSetting::instance();
|
|
$settings->update([
|
|
'brand_name' => 'Amare Brand',
|
|
'email' => 'hello@amare.test',
|
|
'phone' => '(11) 91111-1111',
|
|
'city' => 'São Paulo - SP',
|
|
'default_meta_title' => 'Titulo SEO Amare',
|
|
'default_meta_description' => 'Descricao SEO Amare',
|
|
'default_og_image_path' => 'og/default.jpg',
|
|
'default_og_image_alt' => 'Imagem OG Amare',
|
|
'social_links' => [
|
|
'instagram' => 'https://instagram.com/amare',
|
|
],
|
|
]);
|
|
|
|
$response = $this->get('/');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('<title>Titulo SEO Amare</title>', false)
|
|
->assertSee('name="description"', false)
|
|
->assertSee('Descricao SEO Amare', false)
|
|
->assertSee('rel="canonical"', false)
|
|
->assertSee('property="og:title"', false)
|
|
->assertSee('property="og:description"', false)
|
|
->assertSee('property="og:type"', false)
|
|
->assertSee('property="og:url"', false)
|
|
->assertSee('property="og:image"', false)
|
|
->assertSee('property="og:image:alt"', false)
|
|
->assertSee('Imagem OG Amare', false)
|
|
->assertSee('<header', false)
|
|
->assertSee('<nav', false)
|
|
->assertSee('<main', false)
|
|
->assertSee('<footer', false)
|
|
->assertSee('Amare Brand')
|
|
->assertSee('hello@amare.test')
|
|
->assertSee('(11) 91111-1111')
|
|
->assertSee('Privacidade')
|
|
->assertSee(route('privacy'), false)
|
|
->assertSee('https://instagram.com/amare', false);
|
|
}
|
|
}
|