Story 2.1: navbar responsive

This commit is contained in:
2026-02-04 16:51:55 +01:00
parent 4a5213331d
commit dd6c5d0a72
8 changed files with 231 additions and 40 deletions

25
tests/navbar.test.ps1 Normal file
View File

@@ -0,0 +1,25 @@
$ErrorActionPreference = 'Stop'
function Assert-True {
param(
[bool]$Condition,
[string]$Message
)
if (-not $Condition) { throw $Message }
}
Assert-True (Test-Path 'templates/navbar.php') 'Missing templates/navbar.php'
$navbar = Get-Content -Raw 'templates/navbar.php'
Assert-True ($navbar -match 'mobile-menu-toggle') 'Navbar missing toggle id'
Assert-True ($navbar -match 'nav-link-active') 'Navbar missing active class'
Assert-True (Test-Path 'assets/js/main.js') 'Missing assets/js/main.js'
$js = Get-Content -Raw 'assets/js/main.js'
Assert-True ($js -match 'initMobileMenu') 'Missing initMobileMenu'
Assert-True ($js -match 'initNavbarScroll') 'Missing initNavbarScroll'
Assert-True (Test-Path 'index.php') 'Missing index.php'
$index = Get-Content -Raw 'index.php'
Assert-True ($index -match "include_template\('navbar'") 'index.php missing navbar include'
'OK'

View File

@@ -4,4 +4,5 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path
& (Join-Path $here 'tailwind.test.ps1')
& (Join-Path $here 'templates.test.ps1')
& (Join-Path $here 'canary.test.ps1')
& (Join-Path $here 'navbar.test.ps1')
'OK'