added optional param to m.redraw() to allow forced update

This commit is contained in:
Zolmeister 2014-08-13 12:59:03 -07:00
parent d567de08a8
commit 774be35cc2
3 changed files with 42 additions and 4 deletions

View file

@ -743,6 +743,25 @@ function testMithril(mock) {
mock.requestAnimationFrame.$resolve() //teardown
return count === 3
})
test(function() {
mock.requestAnimationFrame.$resolve() //setup
var count = 0
var root = mock.document.createElement("div")
m.module(root, {
controller: function() {},
view: function(ctrl) {
count++
}
})
mock.requestAnimationFrame.$resolve() //teardown
m.redraw(true) //should run synchronously
m.redraw(true) //forced to run synchronously
m.redraw(true)
m.redraw(true)
mock.requestAnimationFrame.$resolve() //teardown
return count === 5
})
//m.route
test(function() {