Files
docs/悦/PDA(海外)/tests/pallet-detail-scan-order.test.ps1
2026-09-08 14:05:30 +08:00

12 lines
639 B
PowerShell

$ErrorActionPreference = 'Stop'
$html = Get-Content -Raw -Encoding UTF8 -LiteralPath (Join-Path $PSScriptRoot '..\assets\app.js')
$palletView = [regex]::Match($html, '(?s)function palletView\(\).*?(?=function startPallet\()').Value
$scanAt = $palletView.IndexOf('${scanCard}')
$cargoAt = $palletView.IndexOf('${cargoInfo}')
if ($scanAt -lt 0) { throw 'Pallet detail scan module is missing' }
if ($cargoAt -lt 0) { throw 'Pallet detail cargo information module is missing' }
if ($scanAt -gt $cargoAt) { throw 'Pallet detail scan module must appear before cargo information' }
Write-Output 'PASS: pallet detail scan module order contract'