fix(selfop): show inventory observation time range
This commit is contained in:
@@ -50,6 +50,25 @@ beforeEach(() => {
|
||||
})
|
||||
afterEach(() => { wrappers.splice(0).forEach(wrapper => wrapper.unmount()) })
|
||||
describe('self-operated actual workbench request state', () => {
|
||||
it('shows the pinned warehouse inventory collection interval as one full pagination observation', async () => {
|
||||
mocks.api.inventory.mockResolvedValue({ context: { ...context, inventoryObservedFrom: '2026-10-12T00:00:00Z', inventoryObservedUntil: '2026-10-12T00:12:00Z' }, records: [metric], total: 1 })
|
||||
mocks.api.overview.mockResolvedValue({ ...overview, warehouses: [{ warehouseCode: 'WH-A', dataFamily: 'INVENTORY', lastPublishedAt: '2026-10-12T02:00:00Z', inventoryObservedFrom: '2026-10-12T01:30:00Z', inventoryObservedUntil: '2026-10-12T01:45:00Z' } as WarehouseOverview] })
|
||||
const wrapper = mount(AnalyticsView, { ...options, props: { mode: 'inventory' } }); wrappers.push(wrapper)
|
||||
await flushPromises()
|
||||
const note = wrapper.get('[data-testid="inventory-observation"]')
|
||||
expect(note.text()).toContain('2026/10/12 08:00:00 至 2026/10/12 08:12:00')
|
||||
expect(note.text()).toContain('本仓一轮完整分页观测')
|
||||
expect(note.text()).toContain('不代表同一瞬间的库存')
|
||||
expect(note.text()).not.toContain('09:30:00')
|
||||
expect(note.text()).not.toContain('10:00:00')
|
||||
expect(wrapper.findComponent(tableStub).props('columns')[0].prop).toBe('sku')
|
||||
})
|
||||
it('does not invent inventory observation times when no published interval is available', async () => {
|
||||
const wrapper = mount(AnalyticsView, { ...options, props: { mode: 'inventory' } }); wrappers.push(wrapper)
|
||||
await flushPromises()
|
||||
expect(wrapper.get('[data-testid="inventory-observation"]').text()).toContain('— 至 —')
|
||||
expect(wrapper.get('[data-testid="inventory-observation"]').text()).toContain('尚无完整库存观测时段')
|
||||
})
|
||||
it.each(['sales', 'inventory', 'collection'] as const)('uses the public integrated filter region and layout settings for %s', async mode => {
|
||||
const wrapper = mode === 'collection' ? mount(CollectionView, options) : mount(AnalyticsView, { ...options, props: { mode } })
|
||||
wrappers.push(wrapper)
|
||||
|
||||
Reference in New Issue
Block a user