优化
This commit is contained in:
@@ -257,6 +257,25 @@ describe('WarehousesView', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('submits the current keyword once when Enter is pressed in the text filter', async () => {
|
||||
const wrapper = await mountView()
|
||||
const keywordInput = wrapper.find('input[placeholder="仓库名称、编码、城市或地址"]')
|
||||
|
||||
await keywordInput.setValue('AKR1')
|
||||
await keywordInput.trigger('keyup', { key: 'Enter' })
|
||||
await flushPromises()
|
||||
|
||||
expect(listPlatformWarehouses).toHaveBeenCalledTimes(2)
|
||||
expect(listPlatformWarehouses).toHaveBeenLastCalledWith({
|
||||
page: 1,
|
||||
size: 20,
|
||||
keyword: 'AKR1',
|
||||
warehouseType: undefined,
|
||||
status: undefined,
|
||||
})
|
||||
expect(wrapper.findComponent(QueryToolbar).props('loading')).toBe(false)
|
||||
})
|
||||
|
||||
it('shows a recoverable API error without falling back to demo warehouses', async () => {
|
||||
vi.mocked(listPlatformWarehouses).mockRejectedValueOnce(new Error('Gateway unavailable'))
|
||||
const wrapper = await mountView()
|
||||
|
||||
Reference in New Issue
Block a user