Files
docs/悦/PDA(海外)/tests/home-inventory-entry-hidden.test.ps1
2026-09-08 14:05:30 +08:00

16 lines
1.1 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$html = Get-Content -Raw -LiteralPath (Join-Path $PSScriptRoot '..\assets\app.js')
$workbenchView = [regex]::Match($html, '(?s)function workbenchView\(\).*?(?=function openPlan)').Value
if (-not $workbenchView) { throw 'Workbench view is missing' }
if ($workbenchView.Contains("navigate('inventory')")) { throw 'Home still exposes the inventory entry' }
if ($workbenchView.Contains('more-entry')) { throw 'Home still exposes the More operations entry' }
$emptyInternalSection = '<div class="section-title"><h2>${t(''internal'')}</h2><span>${t(''inventory'')}</span></div><div class="entry-grid"></div><div class="task-strip">'
if (-not $workbenchView.Contains($emptyInternalSection)) { throw 'Home does not retain the empty Warehouse section' }
if (-not $html.Contains('function inventoryView()')) { throw 'Inventory page implementation was removed' }
if (-not $html.Contains("state.page==='inventory'?inventoryView()")) { throw 'Inventory page render route was removed' }
Write-Output 'PASS: home internal entries hidden while empty section and inventory page remain'