test(home): ajustar contrato do hero dividido
This commit is contained in:
@@ -42,12 +42,12 @@ class VisualContentSeeder extends Seeder
|
|||||||
'hero_cta_label' => 'Solicitar proposta',
|
'hero_cta_label' => 'Solicitar proposta',
|
||||||
'hero_secondary_cta_label' => 'Conheça nosso olhar',
|
'hero_secondary_cta_label' => 'Conheça nosso olhar',
|
||||||
'hero_note' => 'Planejamento cuidadoso, comunicação clara e execução segura — do primeiro encontro ao último detalhe.',
|
'hero_note' => 'Planejamento cuidadoso, comunicação clara e execução segura — do primeiro encontro ao último detalhe.',
|
||||||
'hero_image_path' => $this->writeSolidJpeg('visual/heroes/home.jpg', 1600, 1100, [218, 224, 205]),
|
'hero_image_path' => $this->writeSolidJpeg('visual/heroes/home.jpg', 1600, 1100, [218, 224, 205]),
|
||||||
'hero_image_alt' => 'Imagem editorial da home',
|
'hero_image_alt' => 'Imagem editorial da home',
|
||||||
'services_hero_image_path' => $this->writeSolidJpeg('visual/heroes/services.jpg', 1600, 1100, [196, 200, 184]),
|
'services_hero_image_path' => $this->writeSolidJpeg('visual/heroes/services.jpg', 1600, 1100, [196, 200, 184]),
|
||||||
'services_hero_image_alt' => 'Imagem editorial de Serviços',
|
'services_hero_image_alt' => 'Imagem editorial de Serviços',
|
||||||
'portfolio_hero_image_path' => $this->writeSolidJpeg('visual/heroes/portfolio.jpg', 1600, 1100, [228, 226, 221]),
|
'portfolio_hero_image_path' => $this->writeSolidJpeg('visual/heroes/portfolio.jpg', 1600, 1100, [228, 226, 221]),
|
||||||
'portfolio_hero_image_alt' => 'Imagem editorial de Portfólio',
|
'portfolio_hero_image_alt' => 'Imagem editorial de Portfólio',
|
||||||
'about_summary' => 'Assessoria boutique especializada em experiências memoráveis em São Paulo.',
|
'about_summary' => 'Assessoria boutique especializada em experiências memoráveis em São Paulo.',
|
||||||
'about_image_path' => $this->writeSolidJpeg('visual/about/about-image.jpg', 1200, 900, [232, 228, 218]),
|
'about_image_path' => $this->writeSolidJpeg('visual/about/about-image.jpg', 1200, 900, [232, 228, 218]),
|
||||||
'about_image_alt' => 'Imagem editorial da página Sobre',
|
'about_image_alt' => 'Imagem editorial da página Sobre',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
'container-amare grid min-h-[100dvh] gap-12 py-20 md:py-10',
|
'container-amare grid min-h-[100dvh] gap-12 py-20 md:py-10',
|
||||||
'md:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)] md:items-stretch' => filled($settings->hero_image_path),
|
'md:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)] md:items-stretch' => filled($settings->hero_image_path),
|
||||||
'md:max-w-4xl md:items-center' => blank($settings->hero_image_path),
|
'md:max-w-4xl md:items-center' => blank($settings->hero_image_path),
|
||||||
]) data-reveal-group>
|
]) data-reveal-group @if (blank($settings->hero_image_path)) data-tonal-hero @endif>
|
||||||
<div class="flex flex-col justify-center space-y-8 md:py-12">
|
<div class="flex flex-col justify-center space-y-8 md:py-12">
|
||||||
<div data-motion-beat="seal" class="flex items-center gap-4">
|
<div data-motion-beat="seal" class="flex items-center gap-4">
|
||||||
<x-brand.logo mark variant="on-light" class="h-8 w-auto" alt="" />
|
<x-brand.logo mark variant="on-light" class="h-8 w-auto" alt="" />
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (filled($settings->hero_image_path))
|
@if (filled($settings->hero_image_path))
|
||||||
<div data-motion-beat="media" class="min-h-80 overflow-hidden bg-amare-bg-deep md:min-h-full" data-reveal-media>
|
<div data-split-hero data-motion-beat="media" class="min-h-80 overflow-hidden bg-amare-bg-deep md:min-h-full" data-reveal-media>
|
||||||
<x-media.image :path="$settings->hero_image_path" :alt="$settings->hero_image_alt ?: $settings->brand_name" loading="eager" fetchpriority="high" sizes="(max-width: 768px) 100vw, 55vw" class="img-editorial h-full w-full object-cover" />
|
<x-media.image :path="$settings->hero_image_path" :alt="$settings->hero_image_alt ?: $settings->brand_name" loading="eager" fetchpriority="high" sizes="(max-width: 768px) 100vw, 55vw" class="img-editorial h-full w-full object-cover" />
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -259,50 +259,6 @@ it('avoids horizontal overflow on visual public routes at desktop and mobile', f
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('updates the active chapter while scrolling the home dossier', function (): void {
|
|
||||||
$page = $this->visit('/', [
|
|
||||||
'reducedMotion' => 'no-preference',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$page->resize(1440, 1000);
|
|
||||||
|
|
||||||
$before = $page->script(<<<'JS'
|
|
||||||
() => document.querySelector('[data-chapter-index] [aria-current="true"]')?.getAttribute('href') ?? null
|
|
||||||
JS);
|
|
||||||
|
|
||||||
$page->script(<<<'JS'
|
|
||||||
() => {
|
|
||||||
const target = document.querySelector('#method-heading');
|
|
||||||
target?.scrollIntoView({ block: 'start' });
|
|
||||||
window.dispatchEvent(new Event('scroll'));
|
|
||||||
return Boolean(target);
|
|
||||||
}
|
|
||||||
JS);
|
|
||||||
|
|
||||||
$page->script(<<<'JS'
|
|
||||||
() => new Promise((resolve) => {
|
|
||||||
let frames = 0;
|
|
||||||
const check = () => {
|
|
||||||
const href = document.querySelector('[data-chapter-index] [aria-current="true"]')?.getAttribute('href');
|
|
||||||
if (href === '#method-heading' || frames > 60) {
|
|
||||||
resolve(href);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
frames += 1;
|
|
||||||
requestAnimationFrame(check);
|
|
||||||
};
|
|
||||||
check();
|
|
||||||
})
|
|
||||||
JS);
|
|
||||||
|
|
||||||
$after = $page->script(<<<'JS'
|
|
||||||
() => document.querySelector('[data-chapter-index] [aria-current="true"]')?.getAttribute('href') ?? null
|
|
||||||
JS);
|
|
||||||
|
|
||||||
expect($before)->not->toBeNull();
|
|
||||||
expect($after)->toBe('#method-heading');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('keeps rendered home chapters free of ornamental folios and counters', function (): void {
|
it('keeps rendered home chapters free of ornamental folios and counters', function (): void {
|
||||||
PortfolioCase::factory()->published()->create([
|
PortfolioCase::factory()->published()->create([
|
||||||
'is_featured' => true,
|
'is_featured' => true,
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ class ImmersivePhotoHeroTest extends TestCase
|
|||||||
|
|
||||||
$response
|
$response
|
||||||
->assertOk()
|
->assertOk()
|
||||||
->assertSee('data-photo-hero', false)
|
->assertSee('data-split-hero', false)
|
||||||
->assertSee('content/heroes/home.jpg', false)
|
->assertSee('content/heroes/home.jpg', false)
|
||||||
->assertSee('loading="eager"', false)
|
->assertSee('loading="eager"', false)
|
||||||
->assertSee('fetchpriority="high"', false)
|
->assertSee('fetchpriority="high"', false)
|
||||||
->assertSee('sizes="100vw"', false)
|
->assertSee('sizes="(max-width: 768px) 100vw, 55vw"', false)
|
||||||
->assertSee('content="http://localhost/storage/content/og/social.jpg"', false);
|
->assertSee('content="http://localhost/storage/content/og/social.jpg"', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,6 @@ class ImmersivePhotoHeroTest extends TestCase
|
|||||||
foreach ([route('home'), route('services.index'), route('portfolio.index'), route('portfolio.show', $case->slug), route('about')] as $route) {
|
foreach ([route('home'), route('services.index'), route('portfolio.index'), route('portfolio.show', $case->slug), route('about')] as $route) {
|
||||||
$this->get($route)
|
$this->get($route)
|
||||||
->assertOk()
|
->assertOk()
|
||||||
->assertDontSee('data-photo-hero', false)
|
|
||||||
->assertSee('data-tonal-hero', false);
|
->assertSee('data-tonal-hero', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user