✨ Story 2.1: navbar responsive
This commit is contained in:
25
tests/navbar.test.ps1
Normal file
25
tests/navbar.test.ps1
Normal 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'
|
||||
Reference in New Issue
Block a user