added optional param to m.redraw() to allow forced update
This commit is contained in:
parent
d567de08a8
commit
774be35cc2
3 changed files with 42 additions and 4 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue