diff --git a/resources/views/showcase/layout.blade.php b/resources/views/showcase/layout.blade.php index bb951fbe..7014633e 100644 --- a/resources/views/showcase/layout.blade.php +++ b/resources/views/showcase/layout.blade.php @@ -6,7 +6,8 @@ @php $sections ??= \NoNameWeb\LivewireMaterial\Showcase\Sections::all(); $section ??= null; - $title = $section !== null ? $sections[$section]['title'] : 'Livewire Material'; + // A page of a section's own (a canonical layout, ShowcaseController::layout()) names itself. + $title ??= $section !== null ? $sections[$section]['title'] : 'Livewire Material'; $destinations = [[ 'title' => 'Overview', diff --git a/tests/Feature/ShowcaseTest.php b/tests/Feature/ShowcaseTest.php index ca30e334..78ff29ce 100644 --- a/tests/Feature/ShowcaseTest.php +++ b/tests/Feature/ShowcaseTest.php @@ -53,9 +53,10 @@ it('gives every section a page of its own, linked from the overview and the rail }); it('gives each canonical layout a page of its own, linked from the Layout section', function () { - foreach (['list-detail', 'supporting-pane', 'feed'] as $page) { + foreach (['list-detail' => 'List-detail', 'supporting-pane' => 'Supporting pane', 'feed' => 'Feed'] as $page => $title) { test()->withoutVite()->get("/material/layout/{$page}") ->assertOk() + ->assertSee("{$title} · Layout · Livewire Material", false) ->assertSee('id="example-'.$page.'"', false) // Its own navigation reaches the other three pages, including itself. ->assertSee(route('livewire-material.layout', 'list-detail', false), false)