Browse Source

test(range):test update(#1134)

lkjh3214 3 years ago
parent
commit
b65575a5ab
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/packages/__VUE/range/__test__/range.spec.ts

+ 11 - 0
src/packages/__VUE/range/__test__/range.spec.ts

@@ -112,3 +112,14 @@ test('should emit "change" event after dragging button', () => {
   triggerDrag(button, 50, 0);
   expect(wrapper.emitted('change')!.pop()).toEqual([100]);
 });
+test('should emit "update:modelValue" event after dragging button', () => {
+  const wrapper = mount(Range, {
+    props: {
+      modelValue: 10
+    }
+  });
+
+  const button = wrapper.find('.nut-range-button');
+  triggerDrag(button, 50, 0);
+  expect(wrapper.emitted('update:modelValue')!.pop()).toEqual([100]);
+});