mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-04-24 15:01:22 +08:00
test(layout): add test (#2924)
This commit is contained in:
parent
bb59bb9d70
commit
10c3a53be5
@ -160,4 +160,27 @@ describe('n-layout', () => {
|
||||
)
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it('should work with `sider-placement` prop', async () => {
|
||||
const wrapper = mount(NLayout, {
|
||||
props: {
|
||||
hasSider: true
|
||||
},
|
||||
slots: {
|
||||
default: () => [
|
||||
h(NLayoutSider, null, { default: () => 'test-sider' }),
|
||||
h(NLayoutContent, null, { default: () => 'test-footer' })
|
||||
]
|
||||
}
|
||||
})
|
||||
expect(wrapper.find('.n-layout-sider').classes()).toContain(
|
||||
'n-layout-sider--left-placement'
|
||||
)
|
||||
|
||||
await wrapper.setProps({ siderPlacement: 'right' })
|
||||
expect(wrapper.find('.n-layout-sider').classes()).toContain(
|
||||
'n-layout-sider--right-placement'
|
||||
)
|
||||
wrapper.unmount()
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user