feat: expor vertentes Casamentos/Corporate na jornada pública
Fecha o gap do MAN-126 na navegação e no portfólio: âncoras das duas vertentes no header/footer, filtro por event_type e empty state honesto para Corporate sem prova inventada. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Tests\Feature\Application\Queries\Marketing;
|
||||
|
||||
use App\Application\Queries\Marketing\GetPublishedPortfolioCases;
|
||||
use App\Domain\Marketing\PortfolioVertical;
|
||||
use App\Models\PortfolioCase;
|
||||
use App\Models\PortfolioImage;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -58,4 +59,26 @@ class GetPublishedPortfolioCasesTest extends TestCase
|
||||
$this->assertTrue($cases->get(0)?->relationLoaded('images'));
|
||||
$this->assertCount(2, $cases->get(0)?->images ?? []);
|
||||
}
|
||||
|
||||
public function test_filters_published_cases_by_portfolio_vertical(): void
|
||||
{
|
||||
PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Wedding Case',
|
||||
'event_type' => 'Mini wedding',
|
||||
'sort_order' => 10,
|
||||
]);
|
||||
PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Corporate Case',
|
||||
'event_type' => 'Evento corporativo',
|
||||
'sort_order' => 20,
|
||||
]);
|
||||
|
||||
$weddings = (new GetPublishedPortfolioCases)(PortfolioVertical::Casamentos);
|
||||
$corporate = (new GetPublishedPortfolioCases)(PortfolioVertical::Corporate);
|
||||
|
||||
$this->assertCount(1, $weddings);
|
||||
$this->assertSame('Wedding Case', $weddings->first()?->title);
|
||||
$this->assertCount(1, $corporate);
|
||||
$this->assertSame('Corporate Case', $corporate->first()?->title);
|
||||
}
|
||||
}
|
||||
|
||||
60
tests/Feature/PublicSite/PortfolioVerticalFilterTest.php
Normal file
60
tests/Feature/PublicSite/PortfolioVerticalFilterTest.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\PublicSite;
|
||||
|
||||
use App\Models\PortfolioCase;
|
||||
use App\Models\SiteSetting;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PortfolioVerticalFilterTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_portfolio_index_filters_by_vertical_and_shows_corporate_empty_state(): void
|
||||
{
|
||||
SiteSetting::instance();
|
||||
|
||||
PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Casamento Jardim',
|
||||
'slug' => 'casamento-jardim',
|
||||
'event_type' => 'Casamento',
|
||||
'sort_order' => 10,
|
||||
]);
|
||||
|
||||
PortfolioCase::factory()->published()->create([
|
||||
'title' => 'Convenção Anual',
|
||||
'slug' => 'convencao-anual',
|
||||
'event_type' => 'Corporativo',
|
||||
'sort_order' => 20,
|
||||
]);
|
||||
|
||||
$this->get(route('portfolio.index'))
|
||||
->assertOk()
|
||||
->assertSee('Casamento Jardim')
|
||||
->assertSee('Convenção Anual')
|
||||
->assertSee('Vertentes do portfólio')
|
||||
->assertSee('Casamentos')
|
||||
->assertSee('Corporate');
|
||||
|
||||
$this->get(route('portfolio.index', ['vertente' => 'casamentos']))
|
||||
->assertOk()
|
||||
->assertSee('Casamento Jardim')
|
||||
->assertDontSee('Convenção Anual');
|
||||
|
||||
$this->get(route('portfolio.index', ['vertente' => 'corporate']))
|
||||
->assertOk()
|
||||
->assertSee('Convenção Anual')
|
||||
->assertDontSee('Casamento Jardim');
|
||||
|
||||
PortfolioCase::query()->where('slug', 'convencao-anual')->update(['published_at' => null]);
|
||||
|
||||
$this->get(route('portfolio.index', ['vertente' => 'corporate']))
|
||||
->assertOk()
|
||||
->assertSee('Portfólio Corporate')
|
||||
->assertSee('Conteúdo em construção')
|
||||
->assertDontSee('Convenção Anual');
|
||||
}
|
||||
}
|
||||
43
tests/Feature/PublicSite/PublicNavigationVerticalsTest.php
Normal file
43
tests/Feature/PublicSite/PublicNavigationVerticalsTest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\PublicSite;
|
||||
|
||||
use App\Models\SiteSetting;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PublicNavigationVerticalsTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_header_and_footer_expose_casamentos_and_corporate_without_implying_weddings_only(): void
|
||||
{
|
||||
SiteSetting::instance();
|
||||
|
||||
$response = $this->get(route('about'))->assertOk();
|
||||
|
||||
$homeCasamentos = url('/#casamentos');
|
||||
$homeCorporate = url('/#corporate');
|
||||
|
||||
$response
|
||||
->assertSee('id="main-nav"', false)
|
||||
->assertSee('href="'.$homeCasamentos.'"', false)
|
||||
->assertSee('>Casamentos</a>', false)
|
||||
->assertSee('href="'.$homeCorporate.'"', false)
|
||||
->assertSee('>Corporate</a>', false)
|
||||
->assertSee('href="'.route('portfolio.index').'"', false)
|
||||
->assertSee('href="'.route('about').'"', false)
|
||||
->assertSee('href="'.route('services.index').'"', false)
|
||||
->assertSee('href="'.route('privacy').'"', false)
|
||||
->assertSee('aria-label="Rodapé"', false)
|
||||
->assertSeeInOrder([
|
||||
'aria-label="Rodapé"',
|
||||
'href="'.$homeCasamentos.'"',
|
||||
'Casamentos',
|
||||
'href="'.$homeCorporate.'"',
|
||||
'Corporate',
|
||||
], false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user