修改完成55%
This commit is contained in:
@@ -7,30 +7,44 @@ function Assert-Contains {
|
||||
|
||||
function Assert-NoCssSurface {
|
||||
param([string]$Content, [string]$ClassName)
|
||||
foreach ($property in @('border', 'background', 'border-radius')) {
|
||||
if ($Content -match "(?s)\\.$ClassName\\s*\\{[^}]*\\b$property\\s*:") { throw "T01 must not construct .$ClassName with CSS $property" }
|
||||
foreach ($property in @('border', 'background', 'border-radius', 'box-shadow')) {
|
||||
if ($Content -match "(?s)\.$ClassName\s*\{[^}]*\b$property\s*:") {
|
||||
throw "T01 must not construct .$ClassName with CSS $property"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$pages = Get-Content -LiteralPath (Join-Path $root 'pages.json') -Raw -Encoding utf8 | ConvertFrom-Json
|
||||
$paths = @($pages.pages.path)
|
||||
$t01 = Get-Content -LiteralPath (Join-Path $root 'pages/tree/t01-tree-overview.vue') -Raw -Encoding utf8
|
||||
$t02 = Join-Path $root 'pages/tree/t02-tree-states.vue'
|
||||
$pagePath = Join-Path $root 'pages/tree/t01-tree-overview.vue'
|
||||
$t02Path = Join-Path $root 'pages/tree/t02-tree-states.vue'
|
||||
$page = Get-Content -LiteralPath $pagePath -Raw -Encoding utf8
|
||||
$pages = Get-Content -LiteralPath (Join-Path $root 'pages.json') -Raw -Encoding utf8
|
||||
$catalog = Get-Content -LiteralPath (Join-Path $root 'data/page-catalog.js') -Raw -Encoding utf8
|
||||
|
||||
if (-not ($paths -contains 'pages/tree/t01-tree-overview')) { throw 'T01 route missing' }
|
||||
if ($paths -contains 'pages/tree/t02-tree-states') { throw 'T02 route must be removed; tree states belong to T01' }
|
||||
if (Test-Path -LiteralPath $t02) { throw 'T02 page file must be deleted; tree states belong to T01' }
|
||||
if ($paths.Count -ne 54) { throw "Expected 54 routes after the approved T02-to-T01 state merge, found $($paths.Count)." }
|
||||
if (Test-Path -LiteralPath $t02Path) { throw 'T02 duplicate route file must be removed' }
|
||||
if ($pages -match 'pages/tree/t02-tree-states') { throw 'T02 duplicate route must be removed from pages.json' }
|
||||
if ($catalog -match 't02:') { throw 'T02 duplicate catalog entry must be removed' }
|
||||
if ($page -match "@/utils/api\.js|\bappApi\b") { throw 'T01 design phase must not connect the API layer' }
|
||||
|
||||
foreach ($required in @("const treeState = ref('loading')", "'tree'", "'landscape'", "'empty'", "'error'", 't01-tree-canvas.png', 't01-member-node.png', 't01-member-sheet.png', 'tree-state--landscape', 'tree-state--empty', 'tree-state--error', '/pages/tree/t03-member-profile?genealogyId=', '/pages/tree/t04-add-relative?genealogyId=')) {
|
||||
Assert-Contains -Content $t01 -Expected $required -Message "Missing T01 tree-state contract: $required"
|
||||
}
|
||||
foreach ($required in @(
|
||||
"const treeState = ref('loading')",
|
||||
'tree-state--tree',
|
||||
'tree-state--landscape',
|
||||
'tree-state--empty',
|
||||
'tree-state--error',
|
||||
'tree-canvas--state',
|
||||
'g03-create-flow-panel.png',
|
||||
'g06-search-input-wide.png',
|
||||
'application-status-card.png',
|
||||
'/pages/tree/t03-member-profile',
|
||||
'/pages/tree/t04-add-relative',
|
||||
'/pages/tree/t06-edit-relationship',
|
||||
'/pages/tree/t07-member-directory',
|
||||
'query.genealogyId'
|
||||
)) { Assert-Contains $page $required "Missing T01 contract: $required" }
|
||||
|
||||
foreach ($className in @('tree-canvas', 'member-node', 'member-sheet')) { Assert-NoCssSurface -Content $t01 -ClassName $className }
|
||||
|
||||
foreach ($asset in @('t01-tree-canvas.png', 't01-member-node.png', 't01-member-sheet.png')) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $root "static/assets/modules/tree/opaque/$asset"))) { throw "T01 requires final opaque asset: $asset" }
|
||||
foreach ($className in @('tree-canvas', 'member-node', 'member-sheet', 'tree-state-card')) {
|
||||
Assert-NoCssSurface $page $className
|
||||
}
|
||||
|
||||
Write-Output 'T01-TREE-STATE-CONTRACT PASS'
|
||||
|
||||
Reference in New Issue
Block a user