Files
jiapuapp/tests/f02-document-flow-contract.ps1
T

19 lines
1.1 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot -Parent
$page = [System.IO.File]::ReadAllText((Join-Path $root 'pages/family/f02-publish-feed.vue'), [System.Text.Encoding]::UTF8)
foreach ($expected in @(
'@include adaptive.adaptive-family-content;',
'@include adaptive.adaptive-family-field;'
)) {
if (-not $page.Contains($expected)) { throw "F02 document-flow contract missing: $expected" }
}
if ($page -notmatch '(?s)<textarea[^>]*auto-height') { throw 'F02 publish textarea must grow from its content' }
$style = [regex]::Match($page, '(?s)<style[^>]*>(.*?)</style>').Groups[1].Value
$panelStyle = [regex]::Match($style, '(?ms)^\s*\.publish-panel\s*\{(?<body>.*?)\}').Groups['body'].Value
if ($panelStyle -match '\bmin-height\s*:') { throw 'F02 publish panel height must be driven by its current content' }
if ($page -match '<image\s+(?:[^>]*\s)?class="publish-panel__skin"|publish-field[^>]*>\s*<image') { throw 'F02 decorative frames must be container backgrounds' }
if ($page -match 'position\s*:') { throw 'F02 must keep panel, form, result, and field in document flow' }
Write-Output 'F02-DOCUMENT-FLOW-CONTRACT PASS'