Story 1.4: page canary

This commit is contained in:
2026-02-04 16:00:49 +01:00
parent 2aa77a8c10
commit e868e49881
6 changed files with 73 additions and 25 deletions

18
tests/canary.test.ps1 Normal file
View File

@@ -0,0 +1,18 @@
$ErrorActionPreference = 'Stop'
function Assert-True {
param(
[bool]$Condition,
[string]$Message
)
if (-not $Condition) { throw $Message }
}
Assert-True (Test-Path 'index.php') 'Missing index.php'
$index = Get-Content -Raw 'index.php'
Assert-True ($index -match 'Portfolio') 'index.php missing Portfolio text'
Assert-True ($index -match 'text-primary') 'index.php missing text-primary class'
Assert-True ($index -match 'badge') 'index.php missing badge class'
Assert-True ($index -match 'btn-primary') 'index.php missing btn-primary class'
'OK'

View File

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

View File

@@ -30,7 +30,9 @@ Assert-True (Test-Path 'logs/.gitkeep') 'Missing logs/.gitkeep'
Assert-True (Test-Path 'index.php') 'Missing index.php'
$index = Get-Content -Raw 'index.php'
Assert-True ($index -match 'Hello World') 'index.php missing Hello World'
if (-not ($index -match 'Hello World')) {
Assert-True ($index -match 'Portfolio') 'index.php missing expected content'
}
if (-not ($index -match 'meta name="viewport"')) {
Assert-True (Test-Path 'templates/header.php') 'Missing templates/header.php for viewport meta'
$header = Get-Content -Raw 'templates/header.php'