Files
jiapuapp/tests/r01-document-flow-contract.ps1
T
2026-07-20 17:23:13 +08:00

22 lines
913 B
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',
'pointer-events: none'
)) {
if (-not $page.Contains($expected)) { throw "R01 document-flow contract missing: $expected" }
}
foreach ($selector in @('.people-search input','.people-search__action','.person-card__copy')) {
$escaped = [regex]::Escape($selector)
if ($page -match "(?s)$escaped\s*\{[^}]*position\s*:\s*(absolute|fixed|sticky)\s*;") {
throw "R01 normal content selector uses positioning: $selector"
}
}
if ($page -notmatch '(?s)\.person-card__copy\s*\{[^}]*position\s*:\s*relative\s*;') { throw 'R01 person-card copy must stay in normal flow above its local skin' }
Write-Output 'R01-DOCUMENT-FLOW-CONTRACT PASS'