20 lines
1.5 KiB
PowerShell
20 lines
1.5 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$g03 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g03-create-genealogy.vue') -Raw -Encoding utf8
|
|
|
|
function Assert-Match {
|
|
param([string]$Content, [string]$Pattern, [string]$Message)
|
|
if ($Content -notmatch $Pattern) { throw $Message }
|
|
}
|
|
|
|
if ($g03 -match '<text>返回</text>') { throw 'G03 header must use the shared PageHeader back control' }
|
|
Assert-Match -Content $g03 -Pattern '(?s)<PageHeader\s+title="[^"]+"\s+custom-back\s+@back="backToGenealogies"\s*/>' -Message 'G03 must use PageHeader with its guarded back handler'
|
|
if ($g03 -match 'flow-header|flow-header__back|flow-header__title') { throw 'G03 must not retain a private header implementation' }
|
|
Assert-Match -Content $g03 -Pattern '(?s)\.create-card__note\s*\{[^}]*font-size:\s*clamp\(15px, 25rpx, 18px\);' -Message 'G03 guidance copy must use the approved readable size'
|
|
Assert-Match -Content $g03 -Pattern '(?s)\.access-rule__option\s*\{[^}]*font-size:\s*clamp\(15px, 25rpx, 18px\);' -Message 'G03 visibility options must use the approved readable size'
|
|
Assert-Match -Content $g03 -Pattern '(?s)\.field-error,\s*\.submit-error\s*\{[^}]*font-size:\s*clamp\(15px, 24rpx, 18px\);[^}]*line-height:\s*1\.5;' -Message 'G03 validation errors must use the approved readable size'
|
|
Assert-Match -Content $g03 -Pattern '(?s)\.create-card\s*\.app-button\s*\{[^}]*margin-top:\s*32rpx;' -Message 'G03 primary action spacing must remain stable'
|
|
|
|
Write-Output 'G03-VISUAL-STATES-CONTRACT PASS'
|