[new feature] DropdownItem: add disabled prop

This commit is contained in:
陈嘉涵
2019-05-16 15:07:25 +08:00
parent d07c5b6547
commit 61748ad7c4
9 changed files with 91 additions and 3 deletions

View File

@@ -99,6 +99,32 @@ test('destroy one item', async () => {
expect(wrapper).toMatchSnapshot();
});
test('disable dropdown item', async () => {
const wrapper = mount({
template: `
<dropdown-menu>
<dropdown-item disabled v-model="value" :options="options" />
</dropdown-menu>
`,
components: {
DropdownItem,
DropdownMenu
},
data() {
return {
value: 0,
options: [
{ text: 'A', value: 0 },
{ text: 'B', value: 1 }
]
};
}
});
const title = wrapper.find('.van-dropdown-menu__title');
title.trigger('click');
expect(wrapper).toMatchSnapshot();
});
test('change event', async () => {
const onChange = jest.fn();