✨ Story 1.4: page canary
This commit is contained in:
18
tests/canary.test.ps1
Normal file
18
tests/canary.test.ps1
Normal 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'
|
||||
@@ -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'
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user