feat(phase3): complete loading workbenches
This commit is contained in:
@@ -114,6 +114,7 @@ describe('DataTable column preferences', () => {
|
||||
expect(wrapper.get('.data-table__toolbar-actions').text()).toContain('新增订单')
|
||||
expect(wrapper.get('.data-table__toolbar-actions').text()).toContain('辅助操作')
|
||||
expect(wrapper.get('.data-table__business-actions').text()).toBe('新增订单')
|
||||
expect(wrapper.get('.data-table__utility-actions').text()).toContain('辅助操作')
|
||||
expect(wrapper.get('.data-table__toolbar-end').text()).toBe('辅助操作')
|
||||
})
|
||||
|
||||
@@ -135,6 +136,31 @@ describe('DataTable column preferences', () => {
|
||||
|
||||
expect(wrapper.get('.data-table__toolbar').classes()).toContain('is-compact')
|
||||
expect(wrapper.find('.data-table__toolbar-start').exists()).toBe(false)
|
||||
expect(wrapper.get('.data-table__toolbar-actions').classes()).toContain('has-business-actions')
|
||||
expect(wrapper.get('.data-table__business-actions').text()).toBe('新增订单')
|
||||
})
|
||||
|
||||
it('keeps business actions in a separate mobile-wrappable group from column settings', () => {
|
||||
const wrapper = shallowMount(DataTable, {
|
||||
props: { data: [], columns: configurableColumns, preferenceKey: 'orders-table' },
|
||||
slots: { 'toolbar-actions': '<button class="create-action">新增快递公司</button>' },
|
||||
global: {
|
||||
provide: { [UI_PREFERENCE_SCOPE as symbol]: computed(() => 'user-1') },
|
||||
stubs: {
|
||||
ElTable: TableStub,
|
||||
ElTableColumn: ColumnStub,
|
||||
ElButton: ButtonStub,
|
||||
ElPopover: PopoverStub,
|
||||
},
|
||||
directives: { loading: {} },
|
||||
},
|
||||
})
|
||||
const toolbarActions = wrapper.get('.data-table__toolbar-actions')
|
||||
const businessActions = toolbarActions.get('.data-table__business-actions')
|
||||
|
||||
expect(toolbarActions.classes()).toContain('has-business-actions')
|
||||
expect(businessActions.get('.create-action').text()).toBe('新增快递公司')
|
||||
expect(toolbarActions.find('.data-table__utility-actions').exists()).toBe(true)
|
||||
expect(toolbarActions.find('button[aria-label="列设置"]').exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user