test(order): distinguish publication and final price book states
This commit is contained in:
@@ -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.equal(report.orderSubmissionGates.channel.publicVersionsUnchanged,true)
|
||||||
assert.deepEqual(report.orderSubmissionGates.remaining,['Other pending scope'])
|
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(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.endsWith('/publish')).length,2)
|
||||||
assert.equal(calls.filter(call=>call.path.includes('/submit')).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/')))
|
assert.ok(calls.filter(call=>call.method==='POST').every(call=>!call.path.includes('customerId=0')&&!call.path.includes('/100/')))
|
||||||
|
|||||||
@@ -2613,6 +2613,10 @@ async function orderSubmissionChannelGateModule() {
|
|||||||
const own=await list(customerId,'verify A superseded only within this customer and B active')
|
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')
|
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')
|
&& 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']) {
|
for(const role of ['merchant','platform']) {
|
||||||
await apiStep(module,`${role} original draft rejects now-unavailable channel`,{
|
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}`:''}`,
|
method:'POST',path:`/api/${role}/v1/orders/first-leg/${orderId}/submit${role==='platform'?`?tenantId=${customerId}`:''}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user