fix: restore phase five development acceptance chain
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const callers = [
|
||||
'scripts/admin-test-env-acceptance.mjs',
|
||||
'scripts/client-test-env-acceptance.mjs',
|
||||
'scripts/client-phase2-test-env-acceptance.mjs',
|
||||
'scripts/create-pending-review-orders.mjs',
|
||||
'scripts/pda-final-complete-diagnostic.mjs',
|
||||
'scripts/admin-test-env-modules/domestic-container.mjs',
|
||||
'scripts/admin-test-env-modules/fee-items.mjs',
|
||||
'scripts/admin-test-env-modules/finance-downloads.mjs',
|
||||
'scripts/admin-test-env-modules/finance-reconciliation-full.mjs',
|
||||
'scripts/admin-test-env-modules/order-inbound-status-fixtures.mjs',
|
||||
'scripts/admin-test-env-modules/orders.mjs',
|
||||
'scripts/admin-test-env-modules/phase3-container-customs-fixture.mjs',
|
||||
'scripts/admin-test-env-modules/phase3-customs.mjs',
|
||||
'scripts/admin-test-env-modules/phase3-loading.mjs',
|
||||
'scripts/admin-test-env-modules/phase3-order-splitting.mjs',
|
||||
'scripts/admin-test-env-modules/phase4-overseas-business.mjs',
|
||||
'scripts/admin-test-env-modules/phase4-overseas-client-services.mjs',
|
||||
'scripts/admin-test-env-modules/phase4-overseas-master-data.mjs',
|
||||
'scripts/admin-test-env-modules/phase4-overseas-pda.mjs',
|
||||
'scripts/admin-test-env-modules/suppliers.mjs',
|
||||
'scripts/admin-test-env-modules/system.mjs',
|
||||
]
|
||||
|
||||
test('all acceptance login callers use the canonical loginId request field', async () => {
|
||||
let loginCount = 0
|
||||
for (const file of callers) {
|
||||
const source = await readFile(resolve(file), 'utf8')
|
||||
const canonical = source.match(/\/api\/auth\/login[\s\S]{0,180}loginId\s*:/g) || []
|
||||
assert.ok(canonical.length > 0, `${file} must send loginId`)
|
||||
loginCount += canonical.length
|
||||
assert.doesNotMatch(source,
|
||||
/\/api\/auth\/login[\s\S]{0,180}(?:\busername\s*:|\{\s*username\s*,)/,
|
||||
`${file} must not send removed username`)
|
||||
}
|
||||
assert.ok(loginCount >= 20, `expected broad login coverage, got ${loginCount}`)
|
||||
})
|
||||
Reference in New Issue
Block a user