This commit is contained in:
2026-08-04 12:01:05 +08:00
parent f533024501
commit 3877af0b72
9 changed files with 182 additions and 181 deletions
@@ -6,7 +6,7 @@ const source = readFileSync(new URL('./firstLegPartySource.ts', import.meta.url)
const viewSource = readFileSync(new URL('../views/FirstLegOrdersView.vue', import.meta.url), 'utf8')
const apiSource = readFileSync(new URL('../api/partners.ts', import.meta.url), 'utf8')
test('keeps counterparty availability behind a replaceable read-only source', () => {
test('keeps the legacy counterparty source available without coupling it to first-leg ordering', () => {
assert.match(source, /export interface FirstLegPartySource/)
assert.match(source, /listAvailable\(role/)
assert.match(source, /findAvailable\(id, role/)
@@ -18,10 +18,8 @@ test('keeps counterparty availability behind a replaceable read-only source', ()
assert.match(source, /: \['SHIPPER', 'CONSIGNEE'\]/)
assert.match(source, /await getMerchantPartnerCandidates\(\)/)
assert.doesNotMatch(source, /getMerchantPartnerCandidates\('SENDER'\)|getMerchantPartnerCandidates\('RECEIVER'\)/)
assert.match(viewSource, /firstLegPartySource\.listAvailable\('SHIPPER'\)/)
assert.match(viewSource, /firstLegPartySource\.listAvailable\('CONSIGNEE'\)/)
assert.match(viewSource, /firstLegPartySource\.findAvailable\(id, role\)/)
assert.match(viewSource, /firstLegPartySource\.load\(\)/)
assert.doesNotMatch(viewSource, /firstLegPartySource/)
assert.doesNotMatch(viewSource, /发货单位|收货单位/)
assert.doesNotMatch(viewSource, /DEMO_FIRST_LEG_PARTIES/)
assert.match(apiSource, /url: '\/merchant\/v1\/partners\/candidates'/)
assert.match(apiSource, /'CARRIER' \| 'CUSTOMS_BROKER' \| 'SHIPPER' \| 'CONSIGNEE'/)