mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-07 13:48:31 +08:00
test(log): update test (#1657)
This commit is contained in:
parent
0ac58d8645
commit
376110d8fd
@ -31,4 +31,21 @@ describe('n-log', () => {
|
||||
`line-height: ${lineHeight}`
|
||||
)
|
||||
})
|
||||
|
||||
it('should work with `lines` `log` prop', async () => {
|
||||
const wrapper = mount(NLog, { props: { lines: ['test1', 'test2'] } })
|
||||
expect(wrapper.find('.n-code').element.children.length).toBe(2)
|
||||
expect(wrapper.find('.n-code').element.children[0].textContent).toBe(
|
||||
'test1'
|
||||
)
|
||||
expect(wrapper.find('.n-code').element.children[1].textContent).toBe(
|
||||
'test2'
|
||||
)
|
||||
|
||||
await wrapper.setProps({ log: 'test3' })
|
||||
expect(wrapper.find('.n-code').element.children.length).toBe(1)
|
||||
expect(wrapper.find('.n-code').element.children[0].textContent).toBe(
|
||||
'test3'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user