完成50%
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Read-Utf8([string]$Path) {
|
||||
[System.IO.File]::ReadAllText(
|
||||
@@ -12,32 +12,19 @@ function Assert-Contains {
|
||||
if (-not $Content.Contains($Expected)) { throw $Message }
|
||||
}
|
||||
|
||||
function Decode-Utf8Base64([string]$Value) {
|
||||
[System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($Value))
|
||||
}
|
||||
|
||||
$catalog = Read-Utf8 'data/page-catalog.js'
|
||||
$module = Read-Utf8 'components/ModulePage.vue'
|
||||
$page = Read-Utf8 'pages/family/f05-article-detail.vue'
|
||||
|
||||
foreach ($expected in @(
|
||||
'states: {',
|
||||
"eyebrow: '$(Decode-Utf8Base64 '6LCx5paH5bey5aSx5pWI')'",
|
||||
"title: '$(Decode-Utf8Base64 '6L+Z56+H6LCx5paH5bey5peg5rOV5p+l55yL')'",
|
||||
"copy: '$(Decode-Utf8Base64 '5YaF5a655Y+v6IO95bey6KKr5L2c6ICF5Yig6Zmk5oiW5Y+W5raI5YWs5byA77yM6K+36L+U5Zue6LCx5paH5YiX6KGo5p+l55yL5YW25LuW5YaF5a6544CC')'",
|
||||
"action: '$(Decode-Utf8Base64 '6L+U5Zue6LCx5paH5YiX6KGo')'",
|
||||
"actionMode: 'back'"
|
||||
)) {
|
||||
Assert-Contains $catalog $expected "F05 expired-state catalog contract missing: $expected"
|
||||
}
|
||||
|
||||
foreach ($expected in @(
|
||||
'page.value.states?.[moduleState.value]',
|
||||
'"article-state--expired": articleState.value === "expired"',
|
||||
'expired: { title: "这篇谱文已无法查看"',
|
||||
'当前家谱中不存在这篇谱文,页面不会回退到其他文章。',
|
||||
'findFamilyArticleFixture(genealogyId.value, articleId.value)',
|
||||
':label="stateCopy.action"',
|
||||
'@click="handleStateAction"',
|
||||
'const handleStateAction = () => {',
|
||||
'stateCopy.value.actionMode === "back"',
|
||||
'uni.navigateBack()'
|
||||
'const backToArticles = () =>',
|
||||
'return backToArticles();'
|
||||
)) {
|
||||
Assert-Contains $module $expected "ModulePage state override contract missing: $expected"
|
||||
Assert-Contains $page $expected "F05 real expired-state owner missing: $expected"
|
||||
}
|
||||
|
||||
Write-Output 'F05-EXPIRED-STATE-CONTRACT PASS'
|
||||
|
||||
Reference in New Issue
Block a user