|
@@ -10,7 +10,7 @@ function trigger (target, event, process) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (_.inBrowser) {
|
|
if (_.inBrowser) {
|
|
|
- describe('v-on', function () {
|
|
|
|
|
|
|
+ describe('on-', function () {
|
|
|
|
|
|
|
|
var el
|
|
var el
|
|
|
beforeEach(function () {
|
|
beforeEach(function () {
|
|
@@ -71,6 +71,27 @@ if (_.inBrowser) {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ it('with new syntax key filter', function (done) {
|
|
|
|
|
+ new Vue({
|
|
|
|
|
+ el: el,
|
|
|
|
|
+ template: '<a on-keyup:enter="test">{{a}}</a>',
|
|
|
|
|
+ data: {a: 1},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ test: function () {
|
|
|
|
|
+ this.a++
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ var a = el.firstChild
|
|
|
|
|
+ trigger(a, 'keyup', function (e) {
|
|
|
|
|
+ e.keyCode = 13
|
|
|
|
|
+ })
|
|
|
|
|
+ _.nextTick(function () {
|
|
|
|
|
+ expect(a.textContent).toBe('2')
|
|
|
|
|
+ done()
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
it('warn non-function values', function () {
|
|
it('warn non-function values', function () {
|
|
|
new Vue({
|
|
new Vue({
|
|
|
el: el,
|
|
el: el,
|