mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-07 13:48:31 +08:00
test(affix): add test (#1504)
This commit is contained in:
parent
ca8475752b
commit
2a64db66eb
@ -45,4 +45,21 @@ describe('n-affix', () => {
|
||||
await makeScroll(document.documentElement, 'scrollTop', 200)
|
||||
expect(wrapper.attributes('style')).toContain('top: 120px;')
|
||||
})
|
||||
|
||||
it('should work with `position` prop', async () => {
|
||||
const wrapper = mount(NAffix, {
|
||||
props: {
|
||||
position: 'absolute'
|
||||
},
|
||||
slots: {
|
||||
default: () => {
|
||||
return h('div', {}, 'content')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
expect(wrapper.find('.n-affix--absolute-positioned').exists()).not.toBe(
|
||||
null
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user