Просмотр исходного кода

add test for $argments variable

rhyzx 10 лет назад
Родитель
Сommit
978c86ad23
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      test/unit/specs/instance/events_spec.js

+ 18 - 0
test/unit/specs/instance/events_spec.js

@@ -237,6 +237,24 @@ describe('Instance Events', function () {
       expect(vm.a).toBe(1)
     })
 
+    it('passing $arguments', function () {
+      new Vue({
+        el: document.createElement('div'),
+        template: '<comp @ready="onReady($arguments[1])"></comp>',
+        methods: {
+          onReady: spy
+        },
+        components: {
+          comp: {
+            compiled: function () {
+              this.$emit('ready', 123, 1234)
+            }
+          }
+        }
+      })
+      expect(spy).toHaveBeenCalledWith(1234)
+    })
+
     describe('attached/detached', function () {
 
       it('in DOM', function () {