修正四期全量验收夹具

This commit is contained in:
2026-09-02 16:48:05 +08:00
parent 03d04431f2
commit 6cd477a037
5 changed files with 55 additions and 3 deletions
@@ -59,6 +59,33 @@ test('entry accepts a separate overseas Gateway without exposing token state', (
assert.match(source, /forbiddenValues = \[this\.options\.password, this\.options\.merchantPassword,[\s\S]*this\.token, this\.refreshToken, this\.overseasToken\]/)
})
test('overseas business keeps its marker-scoped customer fixture with reusable credentials configured', () => {
const previousUsername = process.env.MERCHANT_TEST_USERNAME
const previousPassword = process.env.MERCHANT_TEST_PASSWORD
process.env.MERCHANT_TEST_USERNAME = 'reusable-client'
process.env.MERCHANT_TEST_PASSWORD = 'reusable-password'
try {
const modules = parseArguments(['--modules', 'phase4-overseas-business']).modules
assert.ok(modules.includes('merchant-qualification-fixture'))
assert.ok(modules.indexOf('merchant-qualification-fixture') < modules.indexOf('phase4-overseas-business'))
} finally {
if (previousUsername === undefined) delete process.env.MERCHANT_TEST_USERNAME
else process.env.MERCHANT_TEST_USERNAME = previousUsername
if (previousPassword === undefined) delete process.env.MERCHANT_TEST_PASSWORD
else process.env.MERCHANT_TEST_PASSWORD = previousPassword
}
})
test('a fixed origin route does not require randomized order fixtures', () => {
const options = parseArguments(['--origin-warehouse-name', '东莞仓', '--modules', 'phase4-overseas-pda'])
assert.equal(options.originWarehouseName, '东莞仓')
assert.equal(options.routeMode, 'fixed')
assert.equal(options.orderProfileMode, 'fixed')
assert.match(source, /else if \(this\.options\.originWarehouseName \|\| this\.options\.channelName \|\| this\.options\.channelCode\)/)
assert.match(source, /this\.context\.waitSplitRoute = \{[\s\S]*randomize: false/)
assert.match(source, /this\.context\.allowAnyExistingPallet = true/)
})
test('dual-token refresh replaces the whole session only after a complete response', async () => {
const run = new AcceptanceRun({ gateway: 'http://localhost:9000', overseasGateway: 'http://localhost:9300',
username: 'contract-user', password: 'contract-password', modules: [], output: '' })