mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-13 13:59:04 +08:00
test(tree): add test (#3144)
This commit is contained in:
parent
a7f4d50beb
commit
881045a1d0
@ -450,4 +450,28 @@ describe('n-tree', () => {
|
||||
await node[0].trigger('click')
|
||||
expect(wrapper.findAll('.n-tree-node--selected').length).toBe(2)
|
||||
})
|
||||
|
||||
it('should work with `node-props` prop', async () => {
|
||||
const testClass = 'menu-test'
|
||||
const wrapper = mount(NTree, {
|
||||
props: {
|
||||
data: [
|
||||
{
|
||||
label: '1',
|
||||
key: '1'
|
||||
},
|
||||
{
|
||||
label: '2',
|
||||
key: '2'
|
||||
},
|
||||
{
|
||||
label: '3',
|
||||
key: '3'
|
||||
}
|
||||
],
|
||||
nodeProps: () => ({ class: testClass })
|
||||
}
|
||||
})
|
||||
expect(wrapper.find('.n-tree-node').classes()).toContain(testClass)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user