-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhangdaiyan
committed
Apr 18, 2019
1 parent
93ba39e
commit 2f9297b
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Vue from "../src/index.js"; | ||
|
||
describe('Event test', function() { | ||
it('Basic', function() { | ||
var cb = jasmine.createSpy('cb'); | ||
|
||
var vm = new Vue({ | ||
render (h) { | ||
return h('button', { | ||
class: 'btn', | ||
on: { 'click': cb } | ||
}, []) | ||
}, | ||
}).$mount() | ||
|
||
document.body.appendChild(vm.$el) | ||
const btn = document.querySelector('.btn') | ||
expect(btn.tagName).toEqual('BUTTON') | ||
btn.click() | ||
expect(cb).toHaveBeenCalled() | ||
}); | ||
}); |