feat(Checkbox): icon slot add disabled param (#8839)

This commit is contained in:
neverland
2021-06-09 10:14:24 +08:00
committed by GitHub
parent c426125e2c
commit 2e889b2641
7 changed files with 34 additions and 17 deletions

View File

@@ -105,3 +105,14 @@ test('should emit click event when checkbox icon is clicked', async () => {
icon.trigger('click');
expect(onClick).toHaveBeenCalledTimes(2);
});
test('should render icon slot correctly', async () => {
const wrapper = mount(Checkbox, {
slots: {
icon: ({ checked, disabled }) =>
`checked: ${checked}, disabled: ${disabled}`,
},
});
expect(wrapper.find('.van-checkbox__icon').html()).toMatchSnapshot();
});