优化
This commit is contained in:
@@ -93,3 +93,19 @@ it.each(['success', 'failure'])('keeps rows stable during a refresh but rejects
|
||||
expect(() => state.assertCurrent(previous)).toThrow('尚未读取完成')
|
||||
}
|
||||
})
|
||||
|
||||
it('allows mixed-warehouse pages only for the explicitly regional workspace and pins restored drafts to their warehouse', async () => {
|
||||
const error = ref<ApiErrorDetails | null>(null)
|
||||
const state = useDispatchCandidates(error, listDispatchCandidates, true)
|
||||
const second = candidate({ sourceKey: 'ny-source', warehouseId: '654' })
|
||||
vi.mocked(listDispatchCandidates).mockResolvedValueOnce(response({ candidates: [candidate(), second] }))
|
||||
await state.load({ warehouseTab: 'ALL' })
|
||||
expect(state.candidates.value).toHaveLength(2)
|
||||
expect(() => state.assertCurrent([second])).not.toThrow()
|
||||
vi.mocked(listDispatchCandidates).mockResolvedValueOnce(response({ candidates: [candidate()] }))
|
||||
await state.load({ warehouseId: '321', warehouseTab: 'ALL', draftToken: 'server-token' })
|
||||
expect(() => state.assertCurrent([second])).toThrow('组成已变化')
|
||||
const scoped = setup()
|
||||
await scoped.load({ warehouseTab: 'ALL' })
|
||||
expect(listDispatchCandidates).toHaveBeenCalledTimes(2)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user