chore: add trailingComma
This commit is contained in:
@@ -7,19 +7,19 @@ test('empty list', () => {
|
||||
|
||||
const mockItem = {
|
||||
text: 'city1',
|
||||
id: 1
|
||||
id: 1,
|
||||
};
|
||||
|
||||
const mockItem2 = {
|
||||
text: 'city2',
|
||||
id: 2
|
||||
id: 2,
|
||||
};
|
||||
|
||||
const mockItems = [
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem]
|
||||
}
|
||||
children: [mockItem],
|
||||
},
|
||||
];
|
||||
|
||||
test('click-nav event', () => {
|
||||
@@ -28,14 +28,14 @@ test('click-nav event', () => {
|
||||
|
||||
const wrapper = mount(TreeSelect, {
|
||||
propsData: {
|
||||
items: mockItems
|
||||
items: mockItems,
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
navclick: onNavClick,
|
||||
'click-nav': onClickNav
|
||||
}
|
||||
}
|
||||
'click-nav': onClickNav,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const navItems = wrapper.findAll('.van-tree-select__nav-item');
|
||||
@@ -51,14 +51,14 @@ test('click-item event', () => {
|
||||
|
||||
const wrapper = mount(TreeSelect, {
|
||||
propsData: {
|
||||
items: mockItems
|
||||
items: mockItems,
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
itemclick: onItemClick,
|
||||
'click-item': onClickItem
|
||||
}
|
||||
}
|
||||
'click-item': onClickItem,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
@@ -76,15 +76,15 @@ test('click disabled nav', () => {
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem],
|
||||
disabled: true
|
||||
}
|
||||
]
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
'click-nav': onClickNav
|
||||
}
|
||||
}
|
||||
'click-nav': onClickNav,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__nav-item');
|
||||
@@ -102,17 +102,17 @@ test('click disabled item', () => {
|
||||
children: [
|
||||
{
|
||||
...mockItem,
|
||||
disabled: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
'click-item': onClickItem
|
||||
}
|
||||
}
|
||||
'click-item': onClickItem,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
@@ -125,13 +125,13 @@ test('content slot', () => {
|
||||
propsData: {
|
||||
items: [
|
||||
{
|
||||
text: 'group1'
|
||||
}
|
||||
]
|
||||
text: 'group1',
|
||||
},
|
||||
],
|
||||
},
|
||||
scopedSlots: {
|
||||
content: () => 'Custom Content'
|
||||
}
|
||||
content: () => 'Custom Content',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -140,8 +140,8 @@ test('content slot', () => {
|
||||
test('height prop', () => {
|
||||
const wrapper = mount(TreeSelect, {
|
||||
propsData: {
|
||||
height: '100vh'
|
||||
}
|
||||
height: '100vh',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -153,10 +153,10 @@ test('nav info', () => {
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
info: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
info: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -173,9 +173,9 @@ test('use sync modifier in main-active-index', () => {
|
||||
data() {
|
||||
return {
|
||||
mainActiveIndex: -1,
|
||||
items: mockItems
|
||||
items: mockItems,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const navItems = wrapper.findAll('.van-tree-select__nav-item');
|
||||
@@ -200,11 +200,11 @@ test('use sync modifier in active-id', () => {
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem, mockItem2]
|
||||
}
|
||||
]
|
||||
children: [mockItem, mockItem2],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
@@ -229,11 +229,11 @@ test('multiple select', () => {
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem, mockItem2]
|
||||
}
|
||||
]
|
||||
children: [mockItem, mockItem2],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
@@ -262,11 +262,11 @@ test('max prop', () => {
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem, mockItem2]
|
||||
}
|
||||
]
|
||||
children: [mockItem, mockItem2],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
@@ -283,10 +283,10 @@ test('className of nav', () => {
|
||||
{
|
||||
text: 'group1',
|
||||
className: 'my-class',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__nav-item');
|
||||
@@ -310,17 +310,17 @@ test('should sync value before trigger click-item event', done => {
|
||||
items: [
|
||||
{
|
||||
text: 'group1',
|
||||
children: [mockItem, mockItem2]
|
||||
}
|
||||
]
|
||||
children: [mockItem, mockItem2],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onClickItem() {
|
||||
expect(wrapper.vm.activeId).toEqual(mockItem2.id);
|
||||
done();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
|
||||
Reference in New Issue
Block a user