Files
jiapuapp/tests/f06-editor-context-contract.ps1
T
2026-07-24 18:03:14 +08:00

20 lines
891 B
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$page = Get-Content -LiteralPath (Join-Path $root 'pages/family/f06-article-editor.vue') -Raw -Encoding UTF8
foreach ($token in @(
'genealogyId.value = String(query?.genealogyId || "");',
'query?.mode !== "create"',
'const hasValidContext = computed(() => /^[1-9]\d*$/.test(genealogyId.value));',
'returnTo("F04", { genealogyId: genealogyId.value })',
'appApi.createArticle(',
'createRequestController',
'isRequestCancelled'
)) {
if (-not $page.Contains($token)) { throw "F06 editor context missing: $token" }
}
foreach ($forbidden in @('findFamilyArticleFixture', 'form.category', 'form.status', 'uni.redirectTo', '/pages/')) {
if ($page.Contains($forbidden)) { throw "F06 must not retain a context, code-input, or navigation bypass: $forbidden" }
}
Write-Output 'F06-EDITOR-CONTEXT-CONTRACT PASS'