This commit is contained in:
2026-10-22 11:56:54 +08:00
parent 090431b409
commit 3e77c3976e
40 changed files with 976 additions and 241 deletions
@@ -190,6 +190,28 @@ describe('UnifiedOrdersView list request coordination', () => {
}
})
it.each(['全部', '测量数据审核'])('keeps the %s tab bar mounted without a loading text row during query', async (label) => {
const wrapper = mountView()
await flushPromises()
if (label !== '全部') {
await wrapper.findAll('[role="tab"]').find(tab => tab.text() === label)!.trigger('click')
await flushPromises()
}
const tabList = wrapper.get('[role="tablist"]').element
let resolveCounts!: (value: { counts: {} }) => void
vi.mocked(getPlatformUnifiedOrderStatusCounts).mockImplementationOnce(() => new Promise(resolve => { resolveCounts = resolve }))
wrapper.getComponent({ name: 'QueryToolbar' }).vm.$emit('search')
await flushPromises()
expect(wrapper.get('[role="tablist"]').element).toBe(tabList)
expect(wrapper.get('[role="tablist"]').attributes('aria-busy')).toBe('true')
expect(wrapper.find('.order-status-feedback').exists()).toBe(false)
resolveCounts({ counts: {} })
await flushPromises()
expect(wrapper.get('[role="tablist"]').element).toBe(tabList)
expect(wrapper.get('[role="tablist"]').attributes('aria-busy')).toBe('false')
wrapper.unmount()
})
it.each(['success', 'failure'] as const)('ignores an older tab request %s after the current tab has loaded', async (outcome) => {
const wrapper = mountView()
await flushPromises()