Name each canonical layout page in its window title
Plan step 38 review: ShowcaseController::layout() passes a title
("List-detail · Layout"), but the frame overwrote it with the section's
own, so all three pages and the Layout overview shared one title. The
frame keeps a title it was given; the layout page test asserts each.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Opus 5
parent
1945f8233a
commit
783f7902cc
@@ -6,7 +6,8 @@
|
|||||||
@php
|
@php
|
||||||
$sections ??= \NoNameWeb\LivewireMaterial\Showcase\Sections::all();
|
$sections ??= \NoNameWeb\LivewireMaterial\Showcase\Sections::all();
|
||||||
$section ??= null;
|
$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 = [[
|
$destinations = [[
|
||||||
'title' => 'Overview',
|
'title' => 'Overview',
|
||||||
|
|||||||
@@ -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 () {
|
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}")
|
test()->withoutVite()->get("/material/layout/{$page}")
|
||||||
->assertOk()
|
->assertOk()
|
||||||
|
->assertSee("<title>{$title} · Layout · Livewire Material</title>", false)
|
||||||
->assertSee('id="example-'.$page.'"', false)
|
->assertSee('id="example-'.$page.'"', false)
|
||||||
// Its own navigation reaches the other three pages, including itself.
|
// Its own navigation reaches the other three pages, including itself.
|
||||||
->assertSee(route('livewire-material.layout', 'list-detail', false), false)
|
->assertSee(route('livewire-material.layout', 'list-detail', false), false)
|
||||||
|
|||||||
Reference in New Issue
Block a user