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

13 lines
1.1 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot -Parent
$publish = [System.IO.File]::ReadAllText((Join-Path $root 'pages/family/f02-publish-feed.vue'), [System.Text.Encoding]::UTF8)
$editor = [System.IO.File]::ReadAllText((Join-Path $root 'pages/family/f06-article-editor.vue'), [System.Text.Encoding]::UTF8)
if ($publish -match 'position\s*:') { throw 'F02 must keep its editor in document flow' }
if ($editor -match 'position\s*:') { throw 'F06 must keep its editor in document flow' }
if (-not $publish.Contains('background: url("/static/assets/modules/family/transparent/module-field-frame.png") center / 100% 100% no-repeat')) { throw 'F02 field frame must be a container background' }
if (-not $editor.Contains('background: url("/static/assets/modules/family/transparent/module-field-frame.png") center / 100% 100% no-repeat')) { throw 'F06 field frame must be a container background' }
if ($editor -match '<view[^>]+class="editor-control[^>]*>\s*<image') { throw 'F06 control must not retain a positioned decorative image' }
Write-Output 'FAMILY-EDITORS-DOCUMENT-FLOW-CONTRACT PASS'