Commit 4cd4b08f authored by S Anand's avatar S Anand
Browse files

TST: bind to events only once for testing

parent 47ce8710
import {parse} from './url.js'
import {hasdata} from './jquery.util.js'
import {hasdata} from './_util.js'
export function urlfilter(options) {
options = options || {}
......
......@@ -137,15 +137,15 @@
$('.selector-div, .selector-iframe').each(function() {
var $this = $(this)
var $target = $($this.data('target'))
.on('load', function(e) {
.one('load', function(e) {
t.equal(e.type, 'load', 'load event')
t.equal($target.attr('src'), 'empty.html?y=1&x=1')
t.ok(e.url)
t.ok(e.url, 'load event url exists')
})
$this
.on('urlfilter', function (e) {
.one('urlfilter', function (e) {
t.equal(e.type, 'urlfilter', 'urlfilter event')
t.ok(e.url)
t.ok(e.url, 'urlfilter event url exists')
})
.dispatch('click')
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment