Files
jiapuapp/tests/g05-all-states-visual-contract.ps1
T

19 lines
1.8 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$g05 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g05-genealogy-overview.vue') -Raw -Encoding utf8
function Assert-Match { param([string]$Pattern,[string]$Message); if ($g05 -notmatch $Pattern) { throw $Message } }
Assert-Match 'overview-surface--state' 'G05 system states must own an independent surface'
Assert-Match '(?s)\.overview-state\s*\{[^}]*@include\s+adaptive\.adaptive-genealogy-state-panel;' 'G05 system states must consume the shared adaptive state-panel profile'
Assert-Match '(?s)class="overview-state__seal".*?brand-seal\.png' 'G05 non-loading states must use the approved red-gold seal'
Assert-Match '(?s)\.overview-surface\s*\{[^}]*@include\s+adaptive\.adaptive-g05-overview-surface;' 'G05 ready surface must consume the shared adaptive overview profile'
Assert-Match '(?s)\.overview-state__seal\s*\{[^}]*width:\s*132rpx;[^}]*height:\s*136rpx;' 'G05 state seal must use the approved size'
Assert-Match 'overview-action-lock' 'G05 member mode must explain owner-only actions instead of leaving blank cells'
Assert-Match '(?s)\.overview-actions\s*\{[^}]*min-height:\s*386rpx;' 'G05 actions must retain a minimum two-row surface while allowing data growth'
Assert-Match '(?s)\.overview-public__details > view:nth-child\(5\)\s*\{[^}]*grid-column:\s*1 / -1;' 'G05 public fifth identity detail must span the full row'
Assert-Match '(?s)</view>\s*<view class="overview-public__notice">.*publicDescription.*</view>\s*<view class="overview-public__action"' 'G05 public description must occupy the dedicated bottom note surface'
Assert-Match '(?s)\.overview-public__action\s*\{[^}]*min-height:\s*82rpx;' 'G05 public action must retain its visual minimum while allowing the public content to grow'
Write-Output 'G05-ALL-STATES-VISUAL-CONTRACT PASS'