test(overseas): retain marker merchant fixture
This commit is contained in:
@@ -328,7 +328,14 @@ export function parseArguments(argv) {
|
|||||||
const modules = normalizeModuleOrder(requestedModules)
|
const modules = normalizeModuleOrder(requestedModules)
|
||||||
const merchantUsername = values.get('merchant-username') || process.env.MERCHANT_TEST_USERNAME || ''
|
const merchantUsername = values.get('merchant-username') || process.env.MERCHANT_TEST_USERNAME || ''
|
||||||
const merchantPassword = values.get('merchant-password') || process.env.MERCHANT_TEST_PASSWORD || ''
|
const merchantPassword = values.get('merchant-password') || process.env.MERCHANT_TEST_PASSWORD || ''
|
||||||
if (merchantUsername && merchantPassword && !modules.includes('phase4-overseas-business')) {
|
const requiresMarkerOwnedMerchantFixture = [
|
||||||
|
'phase4-overseas-business',
|
||||||
|
'phase4-overseas-client-services',
|
||||||
|
'phase5-overseas-fulfillment',
|
||||||
|
'phase4-overseas-finance-cross-region',
|
||||||
|
'phase4-overseas-wallet-and-pallet-cost',
|
||||||
|
].some((module) => modules.includes(module))
|
||||||
|
if (merchantUsername && merchantPassword && !requiresMarkerOwnedMerchantFixture) {
|
||||||
const fixtureIndex = modules.indexOf('merchant-qualification-fixture')
|
const fixtureIndex = modules.indexOf('merchant-qualification-fixture')
|
||||||
if (fixtureIndex >= 0) modules.splice(fixtureIndex, 1)
|
if (fixtureIndex >= 0) modules.splice(fixtureIndex, 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import test from 'node:test'
|
|||||||
import assert from 'node:assert/strict'
|
import assert from 'node:assert/strict'
|
||||||
import { readFile } from 'node:fs/promises'
|
import { readFile } from 'node:fs/promises'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
|
import { parseArguments } from '../admin-test-env-acceptance.mjs'
|
||||||
|
|
||||||
const source = await readFile(fileURLToPath(new URL('./phase4-overseas-client-services.mjs', import.meta.url)), 'utf8')
|
const source = await readFile(fileURLToPath(new URL('./phase4-overseas-client-services.mjs', import.meta.url)), 'utf8')
|
||||||
|
|
||||||
@@ -57,3 +58,14 @@ test('module records marker-owned resources without forbidden fulfillment cleanu
|
|||||||
assert.match(source, /discardNo = discardNo/)
|
assert.match(source, /discardNo = discardNo/)
|
||||||
assert.match(source, /no outbound, dispatch, PDA or delivery action is invoked/)
|
assert.match(source, /no outbound, dispatch, PDA or delivery action is invoked/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('focused client services keeps the marker-owned merchant fixture when reusable credentials exist', () => {
|
||||||
|
const parsed = parseArguments([
|
||||||
|
'--modules', 'phase4-overseas-client-services',
|
||||||
|
'--merchant-username', 'existing-merchant',
|
||||||
|
'--merchant-password', 'existing-password',
|
||||||
|
])
|
||||||
|
const fixture = parsed.modules.indexOf('merchant-qualification-fixture')
|
||||||
|
const clientServices = parsed.modules.indexOf('phase4-overseas-client-services')
|
||||||
|
assert.ok(fixture >= 0 && fixture < clientServices)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user