test(order): distinguish publication and final price book states

This commit is contained in:
2026-10-03 00:50:52 +08:00
parent 0319bb51a0
commit 1db6e744c8
2 changed files with 5 additions and 0 deletions
@@ -133,6 +133,7 @@ test('channel gate publishes private A then B, proves client removal and rejects
assert.equal(report.orderSubmissionGates.channel.publicVersionsUnchanged,true)
assert.deepEqual(report.orderSubmissionGates.remaining,['Other pending scope'])
assert.equal(books.get('201').version.status,'SUPERSEDED');assert.equal(books.get('202').version.status,'ACTIVE')
assert.equal(JSON.stringify(report.orderSubmissionGates.channel.versions.map(version=>[version.statusAtPublication,version.status])),JSON.stringify([['ACTIVE','SUPERSEDED'],['ACTIVE','ACTIVE']]))
assert.equal(calls.filter(call=>call.path.endsWith('/publish')).length,2)
assert.equal(calls.filter(call=>call.path.includes('/submit')).length,2)
assert.ok(calls.filter(call=>call.method==='POST').every(call=>!call.path.includes('customerId=0')&&!call.path.includes('/100/')))
+4
View File
@@ -2613,6 +2613,10 @@ async function orderSubmissionChannelGateModule() {
const own=await list(customerId,'verify A superseded only within this customer and B active')
assertTrue(own.length===2 && own.some(version=>String(version.id)===a&&version.status==='SUPERSEDED')
&& own.some(version=>String(version.id)===b&&version.status==='ACTIVE'),'exact customer A to B replacement')
for (const entry of proof.versions) {
entry.statusAtPublication = entry.status
entry.status = own.find(version => String(version.id) === entry.id).status
}
for(const role of ['merchant','platform']) {
await apiStep(module,`${role} original draft rejects now-unavailable channel`,{
method:'POST',path:`/api/${role}/v1/orders/first-leg/${orderId}/submit${role==='platform'?`?tenantId=${customerId}`:''}`,