Stop drawing each section's title twice on its page
Plan step 38 review: the frame's structural rule that kept a section's own <h2> for screen readers (Tailwind's [&>section>h2]:sr-only before, a showcase.css rule during the rewrite) was removed as dead weight once every section had a real heading, so each page drew its title twice, the <h1> and an identical headline under it. The <h2>s are md-visually-hidden again, the frame's comment says why, and the section page test asserts it. The Layout section's description said "window size classes"; M3's term is breakpoints. 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
3027f85cef
commit
79ca9a28b4
@@ -35,11 +35,18 @@ it('gives every section a page of its own, linked from the overview and the rail
|
||||
foreach (Sections::all() as $key => $section) {
|
||||
$overview->assertSee(route('livewire-material.section', $key), false);
|
||||
|
||||
$this->withoutVite()
|
||||
$html = $this->withoutVite()
|
||||
->get("/material/{$key}")
|
||||
->assertOk()
|
||||
->assertSee("<title>{$section['title']} · Livewire Material</title>", false)
|
||||
->assertSee('id="'.$key.'"', false);
|
||||
->assertSee('id="'.$key.'"', false)
|
||||
->getContent();
|
||||
|
||||
// The page's <h1> names the section; the section's own <h2> is for a screen reader only,
|
||||
// so the title is not drawn twice.
|
||||
preg_match_all('/<h2\b[^>]*>/', $html, $headings);
|
||||
|
||||
expect($headings[0][0] ?? null)->toBe('<h2 class="md-visually-hidden">', "{$key}'s own <h2> is drawn");
|
||||
}
|
||||
|
||||
$this->get('/material/not-a-section')->assertNotFound();
|
||||
|
||||
Reference in New Issue
Block a user