Skip to content

Commit 78f3a7c

Browse files
committed
test for vm.$nextTick
1 parent cd8a235 commit 78f3a7c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/unit/specs/api/dom_spec.js

+19
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,24 @@ if (_.inBrowser) {
178178

179179
})
180180

181+
describe('$nextTick', function () {
182+
183+
it('should work', function (done) {
184+
var context
185+
var called = false
186+
vm.$nextTick(function () {
187+
called = true
188+
context = this
189+
})
190+
expect(called).toBe(false)
191+
_.nextTick(function () {
192+
expect(called).toBe(true)
193+
expect(context).toBe(vm)
194+
done()
195+
})
196+
})
197+
198+
})
199+
181200
})
182201
}

0 commit comments

Comments
 (0)