52 lines
2.4 KiB
PowerShell
52 lines
2.4 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
function Assert-Contains {
|
|
param([string]$Content, [string]$Expected, [string]$Message)
|
|
if ($Content -notmatch [regex]::Escape($Expected)) { throw $Message }
|
|
}
|
|
|
|
function Assert-NoCssSurface {
|
|
param([string]$Content, [string]$ClassName)
|
|
foreach ($property in @('border', 'border-radius')) {
|
|
if ($Content -match "(?s)\\.$ClassName\\s*\\{[^}]*\\b$property\\s*:") {
|
|
throw "G05 must not construct .$ClassName with CSS $property"
|
|
}
|
|
}
|
|
}
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$g05 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g05-genealogy-overview.vue') -Raw -Encoding utf8
|
|
$profiles = Get-Content -LiteralPath (Join-Path $root 'styles/adaptive-frame-profiles.scss') -Raw -Encoding utf8
|
|
$runtimeSmoke = Get-Content -LiteralPath (Join-Path $root 'tests/g05-overview-runtime-smoke.js') -Raw -Encoding utf8
|
|
$asset = Join-Path $root 'static/assets/modules/genealogy/opaque/g05-overview-surface.png'
|
|
|
|
foreach ($required in @(
|
|
'const overviewState = ref("loading")',
|
|
"query.genealogyId",
|
|
'const viewMode = ref("member")',
|
|
'const accessRole = ref("guest")',
|
|
'findGenealogyFixture',
|
|
'overview-ready',
|
|
'overview-public',
|
|
'overview-state--empty',
|
|
'overview-state--error',
|
|
'overview-state--no-permission',
|
|
'adaptive.adaptive-g05-overview-surface'
|
|
)) {
|
|
Assert-Contains $g05 $required "Missing G05 overview contract: $required"
|
|
}
|
|
Assert-Contains $profiles 'g05-overview-surface.png' 'Adaptive G05 surface profile must own the overview asset'
|
|
foreach ($forbidden in @("from '@/utils/api.js'", 'appApi.', 'uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) {
|
|
if ($g05 -match [regex]::Escape($forbidden)) { throw "G05 retains forbidden implementation: $forbidden" }
|
|
}
|
|
|
|
if ($g05 -match 'g04-first-ancestor') { throw 'G05 must not navigate to the removed G04 route' }
|
|
if ($g05 -match 'toJoinApplication') { throw 'G05 must not mislabel the applicant join form as an owner invitation action' }
|
|
foreach ($className in @('overview-surface', 'overview-action', 'overview-state-panel')) {
|
|
Assert-NoCssSurface $g05 $className
|
|
}
|
|
if (-not (Test-Path -LiteralPath $asset)) { throw 'G05 requires final opaque asset: g05-overview-surface.png' }
|
|
Assert-Contains $runtimeSmoke 'waitForPageLoad' 'G05 runtime smoke must wait for the reload load event before DOM inspection'
|
|
|
|
Write-Output 'G05-OVERVIEW-CONTRACT PASS'
|