优化(直播履约): 改为订单快照事件驱动
This commit is contained in:
@@ -4,6 +4,7 @@ import test from 'node:test'
|
||||
import {
|
||||
applyLiveBindingStateSnapshot,
|
||||
compareCustomerRole,
|
||||
isStaleLiveStateVersion,
|
||||
statusForLive,
|
||||
} from './douyu-fulfillment-service.js'
|
||||
|
||||
@@ -81,6 +82,13 @@ test('已分配账号保持 allocated,不折叠成准备账号', () => {
|
||||
assert.equal(status, 'allocated')
|
||||
})
|
||||
|
||||
test('直播账号状态版本只允许向前推进', () => {
|
||||
assert.equal(isStaleLiveStateVersion(8, 7), true)
|
||||
assert.equal(isStaleLiveStateVersion(8, 8), false)
|
||||
assert.equal(isStaleLiveStateVersion(8, 9), false)
|
||||
assert.equal(isStaleLiveStateVersion(8, 0), false)
|
||||
})
|
||||
|
||||
test('直播账号状态推送忽略空数据和无效任务', async () => {
|
||||
assert.deepEqual(await applyLiveBindingStateSnapshot({ items: [] }), {
|
||||
received: 0,
|
||||
|
||||
Reference in New Issue
Block a user