25 lines
1.3 KiB
JavaScript
25 lines
1.3 KiB
JavaScript
import assert from 'node:assert/strict'
|
|
import { readFileSync } from 'node:fs'
|
|
import test from 'node:test'
|
|
|
|
const entry = readFileSync(new URL('../admin-test-env-acceptance.mjs', import.meta.url), 'utf8')
|
|
const source = readFileSync(new URL('./manual-state-matrix.mjs', import.meta.url), 'utf8')
|
|
|
|
test('default full acceptance includes the retained manual state matrix after lifecycle modules', () => {
|
|
assert.match(entry, /'manual-state-matrix'/)
|
|
assert.ok(entry.indexOf("'phase3-order-splitting'") < entry.indexOf("'manual-state-matrix'"))
|
|
assert.ok(entry.indexOf("'manual-state-matrix'") < entry.indexOf("'finance-full-fixtures'"))
|
|
})
|
|
|
|
test('matrix delegates bounded groups and asserts every declared status has a retained id', () => {
|
|
for (const group of ['order-inbound-status-fixtures', 'manual-state-loading-pda',
|
|
'manual-state-ocean-trucking']) assert.match(source, new RegExp(group))
|
|
assert.doesNotMatch(source, /manual-state-customs-dispatch/)
|
|
assert.match(source, /createdResources\.manualStateMatrix/)
|
|
assert.match(source, /requiredStatuses/)
|
|
assert.match(source, /fixtures\?\.\[status\]\?\.id/)
|
|
assert.match(source, /requiredActions/)
|
|
assert.match(source, /actions\?\.\[action\]\?\.documentId/)
|
|
assert.match(source, /actions\?\.\[action\]\?\.completedAt/)
|
|
})
|