2026-08-24 15:41:36 +08:00
|
|
|
import assert from 'node:assert/strict'
|
|
|
|
|
import { readFileSync } from 'node:fs'
|
|
|
|
|
import test from 'node:test'
|
|
|
|
|
|
2026-09-29 18:47:41 +08:00
|
|
|
const runner = readFileSync(new URL('./phase4-test-frontend-acceptance.mjs', import.meta.url), 'utf8')
|
|
|
|
|
const suite = readFileSync(new URL('./phase4-test-frontend.acceptance.ts', import.meta.url), 'utf8')
|
2026-08-24 15:41:36 +08:00
|
|
|
|
2026-09-29 18:47:41 +08:00
|
|
|
test('test runner requires an explicit test environment and unified gateway', () => {
|
2026-08-24 15:41:36 +08:00
|
|
|
assert.match(runner, /--environment/)
|
2026-09-29 18:47:41 +08:00
|
|
|
assert.match(runner, /environment !== 'test'/)
|
2026-08-24 15:41:36 +08:00
|
|
|
assert.match(runner, /--gateway/)
|
2026-09-29 18:47:41 +08:00
|
|
|
assert.doesNotMatch(runner, /--overseas-gateway|VITE_OVERSEAS/)
|
2026-08-24 16:57:25 +08:00
|
|
|
assert.match(runner, /shell: process\.platform === 'win32'/)
|
|
|
|
|
assert.match(runner, /if \(result\.error\) throw result\.error/)
|
2026-08-24 15:41:36 +08:00
|
|
|
assert.doesNotMatch(runner, /ADMIN_ACCEPTANCE_PASSWORD\s*[:=]\s*['"][^'"]+['"]/)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('live suite uses production auth clients and domain adapters', () => {
|
|
|
|
|
assert.match(suite, /useAuthStore/)
|
2026-09-29 18:47:41 +08:00
|
|
|
assert.match(suite, /refreshAuthenticatedSession/)
|
2026-08-24 15:41:36 +08:00
|
|
|
assert.match(suite, /createQuote/)
|
|
|
|
|
assert.match(suite, /createUsTruckOrder/)
|
|
|
|
|
assert.match(suite, /createLocalLooseboardOrder/)
|
|
|
|
|
assert.match(suite, /listLastMileOrders/)
|
|
|
|
|
assert.match(suite, /listDispatchCandidates/)
|
|
|
|
|
assert.match(suite, /listCarrierScheduleQueries/)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('live suite owns marker resources and redacts credentials from trace reports', () => {
|
|
|
|
|
assert.match(suite, /ADMIN-FRONT-P4-/)
|
|
|
|
|
assert.match(suite, /password\|token\|authorization/i)
|
|
|
|
|
assert.match(suite, /createdResources/)
|
|
|
|
|
assert.match(suite, /coverageGaps/)
|
|
|
|
|
})
|