more tests

This commit is contained in:
Leo Horie 2016-05-24 23:16:43 -04:00
parent a2c01d1d96
commit e7420e72e1
14 changed files with 596 additions and 215 deletions

View file

@ -14,6 +14,19 @@ o.spec("withAttr", function() {
o(spy.args).deepEquals([1])
o(spy.this).equals(context)
})
o("works with attribute", function() {
var target = {
getAttribute: function() {return "readonly"}
}
var spy = o.spy()
var context = {
handler: withAttr("readonly", spy)
}
context.handler({currentTarget: target})
o(spy.args).deepEquals(["readonly"])
o(spy.this).equals(context)
})
o("context arg works", function() {
var spy = o.spy()
var context = {}