31 lines
963 B
PowerShell
31 lines
963 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
function Read-Utf8([string]$Path) {
|
|
[System.IO.File]::ReadAllText(
|
|
(Join-Path (Join-Path $PSScriptRoot '..') $Path),
|
|
[System.Text.Encoding]::UTF8
|
|
)
|
|
}
|
|
|
|
function Assert-Contains {
|
|
param([string]$Content, [string]$Expected, [string]$Message)
|
|
if (-not $Content.Contains($Expected)) { throw $Message }
|
|
}
|
|
|
|
$page = Read-Utf8 'pages/family/f05-article-detail.vue'
|
|
|
|
foreach ($expected in @(
|
|
'"article-state--expired": articleState.value === "expired"',
|
|
'expired: { title: "这篇谱文已无法查看"',
|
|
'当前家谱中不存在这篇谱文,页面不会回退到其他文章。',
|
|
'findFamilyArticleFixture(genealogyId.value, articleId.value)',
|
|
':label="stateCopy.action"',
|
|
'@click="handleStateAction"',
|
|
'const backToArticles = () =>',
|
|
'return backToArticles();'
|
|
)) {
|
|
Assert-Contains $page $expected "F05 real expired-state owner missing: $expected"
|
|
}
|
|
|
|
Write-Output 'F05-EXPIRED-STATE-CONTRACT PASS'
|