mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
test(ellipsis): add test case (#1010)
* test(ellipsis): add test case * Update src/ellipsis/tests/Ellipsis.spec.tsx Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
parent
70fafa6e64
commit
074a3936ac
@ -39,4 +39,24 @@ describe('n-ellipsis', () => {
|
||||
'n-ellipsis--line-clamp'
|
||||
)
|
||||
})
|
||||
|
||||
it('should work with `expand-trigger` prop', async () => {
|
||||
const wrapper = mount(NEllipsis, {
|
||||
props: {
|
||||
expandTrigger: 'click',
|
||||
tooltip: false
|
||||
},
|
||||
slots: { default: () => 'test n-ellipsis' }
|
||||
})
|
||||
|
||||
await wrapper.trigger('click')
|
||||
expect(wrapper.find('.n-ellipsis').attributes('style')).not.toContain(
|
||||
'text-overflow: ellipsis;'
|
||||
)
|
||||
|
||||
await wrapper.trigger('click')
|
||||
expect(wrapper.find('.n-ellipsis').attributes('style')).toContain(
|
||||
'text-overflow: ellipsis;'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user