Files
jiapuapp/tests/m01-module-baseline-contract.ps1
T
2026-07-21 07:53:08 +08:00

49 lines
1.8 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$source = Get-Content 'pages/profile/m01-profile-home.vue' -Raw -Encoding UTF8
$required = @(
'profile-state--ready',
'profile-state--error',
'm01-profile-summary-card.png',
'brand-seal.png',
'auth-divider-knot.png',
'chevron-right.png',
'root-header-hall.png',
'a01-scroll-primary-v3.png',
'a01-icon-lock-v1.png',
'notice.png',
'AppButton',
'/pages/profile/m02-edit-profile',
'/pages/notification/n01-message-center',
'/pages/profile/m03-security-settings',
'/pages/profile/m06-help-center',
'/pages/profile/m10-about-settings'
)
foreach ($token in $required) {
if (-not $source.Contains($token)) {
throw "M01 missing contract token: $token"
}
}
foreach ($forbidden in @('m01-profile-notice-card.png', 'm01-profile-menu-frame.png', 'g03-create-flow-panel.png', 'application-status-card.png', 'g06-search-input-wide.png')) {
if ($source.Contains($forbidden)) {
throw "M01 must not reuse opaque business asset: $forbidden"
}
}
if ($source -match '<image\s+(?:[^>]*\s)?class="(?:profile-hero__frame|profile-scroll-notice__skin|profile-error__skin)"') {
throw 'M01 decorative frames must be container backgrounds instead of positioned image layers'
}
if ($source -match 'position\s*:') { throw 'M01 must keep content and local decoration in flex/grid document flow' }
foreach ($token in @(
'class="profile-hero__content"',
'grid-area: 1 / 1',
'background: url("/static/assets/modules/profile/transparent/m01-profile-summary-card.png") center / 100% 100% no-repeat',
'background: url("/static/assets/foundation/transparent/a01-scroll-primary-v3.png") center / 100% 100% no-repeat'
)) {
if (-not $source.Contains($token)) { throw "M01 missing document-flow token: $token" }
}
Write-Output 'M01-MODULE-BASELINE-CONTRACT PASS'