优化
This commit is contained in:
@@ -37,6 +37,27 @@ describe('admin page layout components', () => {
|
||||
expect(wrapper.text()).toContain('表格')
|
||||
})
|
||||
|
||||
it('removes registered but empty list regions from flex layout', () => {
|
||||
const wrapper = mount(ListPageLayout, {
|
||||
slots: {
|
||||
toolbar: '<div>筛选</div>',
|
||||
state: '<template v-if="false"><div>错误</div></template>',
|
||||
default: '<div>表格</div>',
|
||||
},
|
||||
})
|
||||
expect(wrapper.find('.list-page-layout__state').exists()).toBe(false)
|
||||
expect(wrapper.text()).toBe('筛选表格')
|
||||
})
|
||||
|
||||
it('keeps plain-text list regions visible', () => {
|
||||
const wrapper = mount(ListPageLayout, {
|
||||
slots: { state: '正在同步', default: '表格内容' },
|
||||
})
|
||||
|
||||
expect(wrapper.get('.list-page-layout__state').text()).toBe('正在同步')
|
||||
expect(wrapper.get('.list-page-layout__content').text()).toBe('表格内容')
|
||||
})
|
||||
|
||||
it('supports detail regions and form section descriptions', () => {
|
||||
const detail = mount(DetailPageLayout, {
|
||||
slots: { header: '<h1>详情</h1>', default: '<p>正文</p>', footer: '<button>保存</button>' },
|
||||
|
||||
Reference in New Issue
Block a user