feat(TreeSelect): add className option (#4671)
This commit is contained in:
@@ -262,7 +262,6 @@ test('max prop', () => {
|
||||
data() {
|
||||
return {
|
||||
activeId: [],
|
||||
mainActiveIndex: 0,
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
@@ -278,3 +277,21 @@ test('max prop', () => {
|
||||
items.at(1).trigger('click');
|
||||
expect(wrapper.vm.activeId).toEqual([mockItem.id]);
|
||||
});
|
||||
|
||||
test('className of nav', () => {
|
||||
const wrapper = mount(TreeSelect, {
|
||||
propsData: {
|
||||
mainActiveIndex: 0,
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
className: 'my-class',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__nav-item');
|
||||
expect(items.at(0).element.classList.contains('my-class')).toBeTruthy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user