Files
jiapuapp/tests/n-series-all-states-visual-contract.ps1
T
2026-07-20 06:52:33 +08:00

15 lines
903 B
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$n01 = Get-Content -LiteralPath (Join-Path $root 'pages/notification/n01-message-center.vue') -Raw -Encoding utf8
$capture = Get-Content -LiteralPath (Join-Path $root 'scripts/capture-chrome-page.js') -Raw -Encoding utf8
foreach ($required in @('font-size:\s*21rpx','font-size:\s*23rpx','class="notice-review-action" block','<AppButton\s+block\s+:type="noticeState === ''error''')) {
if ($n01 -notmatch $required) { throw "N01 visual contract missing: $required" }
}
foreach ($required in @('prepareNSeriesState','n01-read-first','n01-mark-all')) {
if (-not $capture.Contains($required)) { throw "N capture state missing: $required" }
}
if ($capture -notmatch 'await prepareNSeriesState\(send, action\)') { throw 'Capture runner does not prepare N series states' }
Write-Output 'N series all-states visual contract passed.'