优化
This commit is contained in:
@@ -200,7 +200,12 @@ describe('LocationsView', () => {
|
||||
const wrapper = await mountView()
|
||||
await selectScope(wrapper)
|
||||
|
||||
expect(wrapper.find('.table-panel .panel-heading').exists()).toBe(false)
|
||||
const panelHeading = wrapper.find('.table-panel .panel-heading')
|
||||
expect(panelHeading.exists()).toBe(true)
|
||||
expect(panelHeading.text()).toContain('库位列表')
|
||||
expect(panelHeading.text()).toContain('共 2 个库位')
|
||||
expect(panelHeading.text()).toContain('新增库位')
|
||||
expect(wrapper.findComponent(QueryToolbar).text()).not.toContain('新增库位')
|
||||
expect(listPlatformWarehouses).toHaveBeenCalledWith(undefined, 1, 200)
|
||||
expect(listPlatformLocations).toHaveBeenLastCalledWith({
|
||||
page: 1,
|
||||
@@ -220,7 +225,7 @@ describe('LocationsView', () => {
|
||||
|
||||
it('opens creation without a list filter and requires the warehouse inside the form', async () => {
|
||||
const wrapper = await mountView()
|
||||
const createButton = wrapper.findAll('button').find((button) => button.text().trim() === '新增库位')
|
||||
const createButton = wrapper.find('.table-panel .panel-heading').findAll('button').find((button) => button.text().trim() === '新增库位')
|
||||
|
||||
expect(createButton?.attributes('disabled')).toBeUndefined()
|
||||
await createButton!.trigger('click')
|
||||
|
||||
Reference in New Issue
Block a user