feat(Rate): add touchable prop (#4361)

This commit is contained in:
neverland
2019-09-04 17:28:43 +08:00
committed by GitHub
parent a3b6744b24
commit 0bd3997373
5 changed files with 26 additions and 5 deletions
+15
View File
@@ -137,3 +137,18 @@ test('size prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('untouchable', () => {
const onChange = jest.fn();
const wrapper = mount(Rate, {
propsData: {
touchable: false
},
listeners: {
change: onChange
}
});
triggerDrag(wrapper, 100, 0);
expect(onChange).toHaveBeenCalledTimes(0);
});