mirror of https://github.com/vuejs/vue.git
test for iframe v-on
This commit is contained in:
parent
5a68ab8412
commit
69d33e4591
|
|
@ -80,7 +80,24 @@ if (_.inBrowser) {
|
|||
})
|
||||
|
||||
it('iframe', function () {
|
||||
// TODO
|
||||
// iframes only gets contentWindow when inserted
|
||||
// into the document
|
||||
document.body.appendChild(el)
|
||||
var spy = jasmine.createSpy()
|
||||
var vm = new Vue({
|
||||
el: el,
|
||||
template: '<iframe v-on="click:test"></iframe>',
|
||||
methods: {
|
||||
test: spy
|
||||
}
|
||||
})
|
||||
var iframeDoc = el.firstChild.contentDocument
|
||||
trigger(iframeDoc, 'click')
|
||||
expect(spy.calls.count()).toBe(1)
|
||||
vm.$destroy()
|
||||
trigger(iframeDoc, 'click')
|
||||
expect(spy.calls.count()).toBe(1)
|
||||
document.body.removeChild(el)
|
||||
})
|
||||
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue