feat: remodelar /sobre conforme mock editorial
All checks were successful
All checks were successful
Alinha a página Sobre à composição aprovada (hero, pilares, Michele, processo, portfólio, CTA), com foto da Michele via CMS e tokens Heritage Editorial. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
118
tests/Feature/PublicSite/AboutPageContentTest.php
Normal file
118
tests/Feature/PublicSite/AboutPageContentTest.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\PublicSite;
|
||||
|
||||
use App\Filament\Pages\ManageSiteSettings;
|
||||
use App\Models\PortfolioCase;
|
||||
use App\Models\SiteSetting;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AboutPageContentTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_about_page_renders_mock_section_order_without_principles_list(): void
|
||||
{
|
||||
SiteSetting::instance()->update([
|
||||
'about_summary' => 'Eventos que refletem propósito, conectam pessoas e criam memórias.',
|
||||
'principles' => ['Princípio que não deve aparecer no sobre'],
|
||||
]);
|
||||
|
||||
$this->get(route('about'))
|
||||
->assertOk()
|
||||
->assertSee('data-motion="page-open"', false)
|
||||
->assertSee('Sobre nós')
|
||||
->assertSee('Sobre a Amare')
|
||||
->assertSee('Eventos que refletem propósito, conectam pessoas e criam memórias.')
|
||||
->assertSee('Atendimento próximo')
|
||||
->assertSee('Planejamento minucioso')
|
||||
->assertSee('Execução tranquila')
|
||||
->assertSee('id="michele"', false)
|
||||
->assertSee('Conheça Michele')
|
||||
->assertSee('Como trabalhamos')
|
||||
->assertSee('Escuta e entendimento')
|
||||
->assertSee('Portfólio em destaque')
|
||||
->assertSee('Vamos criar algo inesquecível juntos?')
|
||||
->assertDontSee('Princípio que não deve aparecer no sobre')
|
||||
->assertDontSee('Personalização sem complicação desnecessária');
|
||||
}
|
||||
|
||||
public function test_about_renders_founder_image_from_cms_when_configured(): void
|
||||
{
|
||||
SiteSetting::instance()->update([
|
||||
'founder_image_path' => 'content/about/founder/michele.jpg',
|
||||
'founder_image_alt' => 'Michele, da Amare',
|
||||
]);
|
||||
|
||||
$this->get(route('about'))
|
||||
->assertOk()
|
||||
->assertSee('content/about/founder/michele.jpg', false)
|
||||
->assertSee('Michele, da Amare')
|
||||
->assertSee('data-about-founder', false);
|
||||
}
|
||||
|
||||
public function test_about_omits_founder_image_request_when_unset(): void
|
||||
{
|
||||
SiteSetting::instance()->update([
|
||||
'founder_image_path' => null,
|
||||
'founder_image_alt' => null,
|
||||
]);
|
||||
|
||||
$html = $this->get(route('about'))->assertOk()->getContent();
|
||||
|
||||
$this->assertStringContainsString('data-about-founder', $html);
|
||||
$this->assertStringNotContainsString('content/about/founder/', $html);
|
||||
$this->assertStringContainsString('data-founder-tonal', $html);
|
||||
}
|
||||
|
||||
public function test_about_portfolio_links_featured_cases(): void
|
||||
{
|
||||
$case = PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Casamento Ana e Lucas',
|
||||
'slug' => 'casamento-ana-lucas',
|
||||
'is_featured' => true,
|
||||
'cover_image_path' => 'content/cases/ana-lucas.jpg',
|
||||
'cover_image_alt' => 'Cerimônia ao ar livre',
|
||||
'sort_order' => 1,
|
||||
]);
|
||||
|
||||
PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Caso não destacado',
|
||||
'slug' => 'nao-destacado',
|
||||
'is_featured' => false,
|
||||
'cover_image_path' => 'content/cases/other.jpg',
|
||||
'sort_order' => 2,
|
||||
]);
|
||||
|
||||
$this->get(route('about'))
|
||||
->assertOk()
|
||||
->assertSee(route('portfolio.show', $case), false)
|
||||
->assertSee('Cerimônia ao ar livre')
|
||||
->assertDontSee(route('portfolio.show', 'nao-destacado'), false);
|
||||
}
|
||||
|
||||
public function test_founder_image_upload_requires_alt_text(): void
|
||||
{
|
||||
Storage::fake('public');
|
||||
$this->actingAs(User::factory()->admin()->create());
|
||||
|
||||
Livewire::test(ManageSiteSettings::class)
|
||||
->set('data.founder_image_path', [UploadedFile::fake()->create('michele.jpg', 100, 'image/jpeg')])
|
||||
->set('data.founder_image_alt', null)
|
||||
->call('save')
|
||||
->assertHasFormErrors(['founder_image_alt' => 'required']);
|
||||
|
||||
Livewire::test(ManageSiteSettings::class)
|
||||
->set('data.founder_image_path', null)
|
||||
->set('data.founder_image_alt', null)
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,14 @@ class ImmersivePhotoHeroTest extends TestCase
|
||||
->assertDontSee('data-split-hero', false)
|
||||
->assertDontSee('content/heroes/home.jpg', false);
|
||||
}
|
||||
|
||||
if ($route === route('about')) {
|
||||
$response
|
||||
->assertSee('data-motion="page-open"', false)
|
||||
->assertSee('data-about-hero', false)
|
||||
->assertDontSee('data-photo-hero', false)
|
||||
->assertDontSee('min-h-[calc(100dvh-5rem)]', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +107,7 @@ class ImmersivePhotoHeroTest extends TestCase
|
||||
'cover_image_alt' => 'Cerimônia ao ar livre',
|
||||
]);
|
||||
|
||||
foreach ([route('services.index'), route('portfolio.index'), route('portfolio.show', $case->slug), route('about')] as $route) {
|
||||
foreach ([route('services.index'), route('portfolio.index'), route('portfolio.show', $case->slug)] as $route) {
|
||||
$this->get($route)
|
||||
->assertOk()
|
||||
->assertSee('data-photo-hero', false)
|
||||
@@ -107,6 +115,15 @@ class ImmersivePhotoHeroTest extends TestCase
|
||||
->assertSee('fetchpriority="high"', false)
|
||||
->assertSee('sizes="(max-width: 1023px) 100vw, 58vw"', false);
|
||||
}
|
||||
|
||||
$this->get(route('about'))
|
||||
->assertOk()
|
||||
->assertSee('data-about-hero', false)
|
||||
->assertSee('content/heroes/about.jpg', false)
|
||||
->assertSee('loading="eager"', false)
|
||||
->assertSee('fetchpriority="high"', false)
|
||||
->assertDontSee('data-photo-hero', false)
|
||||
->assertDontSee('data-tonal-hero', false);
|
||||
}
|
||||
|
||||
public function test_hero_upload_requires_alt_text_only_when_an_image_is_uploaded(): void
|
||||
|
||||
@@ -196,9 +196,11 @@ class PublicPagesTest extends TestCase
|
||||
$this->get(route('about'))
|
||||
->assertOk()
|
||||
->assertSee('Sobre a Amare boutique')
|
||||
->assertSee('São Paulo - SP')
|
||||
->assertSee('Sobre a Amare')
|
||||
->assertSee('Conheça Michele')
|
||||
->assertDontSee('Fortaleza')
|
||||
->assertSee('data-tonal-hero', false);
|
||||
->assertSee('data-tonal-hero', false)
|
||||
->assertSee('data-about-hero', false);
|
||||
|
||||
$this->get(route('privacy'))
|
||||
->assertOk()
|
||||
|
||||
Reference in New Issue
Block a user