refactor(self-operated): simplify collection account monitor

This commit is contained in:
2026-10-13 17:29:45 +08:00
parent 260409c071
commit 133654327d
8 changed files with 202 additions and 556 deletions
@@ -12,6 +12,15 @@ function overview(account: Task | null = source): Overview {
}
const options = { global: { stubs: { 'el-button': true } } }
describe('single account collection monitor', () => {
it('does not claim idle or an empty queue when the first status read fails', () => {
const w = mount(CollectionAccountMonitor, { ...options, props: { overview: null, stale: true } })
expect(w.text()).toContain('暂未取得账号状态')
expect(w.text()).toContain('暂未取得安排')
expect(w.text()).not.toContain('待机')
expect(w.text()).not.toContain('保留最后一次')
expect(w.text()).not.toContain('暂无其他待处理项')
w.unmount()
})
it('shows account work once despite two waiting warehouses and keeps the phase counts', () => {
const w = mount(CollectionAccountMonitor, { ...options, props: { overview: overview() } })
expect(w.findAllComponents(CollectionTaskProgress)).toHaveLength(1)