Files
jiapuapp/tests/r01-document-flow-contract.ps1
T
2026-07-21 07:53:08 +08:00

20 lines
1.0 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot -Parent
$page = [System.IO.File]::ReadAllText((Join-Path $root 'pages/records/r01-people-list.vue'), [System.Text.Encoding]::UTF8)
foreach ($expected in @(
'grid-template-columns: minmax(0, 1fr) 126rpx',
'class="people-state-card__copy"',
'background: url("/static/assets/modules/records/transparent/r01-search-input-frame.png") center / 100% 100% no-repeat',
'background: url("/static/assets/modules/records/transparent/r01-person-name-card.png") center / 100% 100% no-repeat'
)) {
if (-not $page.Contains($expected)) { throw "R01 document-flow contract missing: $expected" }
}
if ($page -match '<image\s+(?:[^>]*\s)?class="person-card__skin"|people-search\s*>\s*<image|people-result-empty\s*>\s*<image|people-state-card\s*>\s*<image') {
throw 'R01 decorative frames must be container backgrounds instead of positioned image layers'
}
if ($page -match 'position\s*:') { throw 'R01 must not use positioning declarations' }
Write-Output 'R01-DOCUMENT-FLOW-CONTRACT PASS'