Skip to content

Commit 485e740

Browse files
committed
test: make tests pass in IE
1 parent 91deb4f commit 485e740

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Diff for: test/unit/features/component/component-async.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ describe('Component async', () => {
340340
expect(vm.$el.textContent).toBe('hi')
341341
expect(`Failed to resolve async component`).not.toHaveBeenWarned()
342342
done()
343-
}, 30)
343+
}, 50)
344344
})
345345
})
346346
})

Diff for: test/unit/features/instance/properties.spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ describe('Instance properties', () => {
165165
}
166166
}).$mount()
167167

168+
// has to be in dom for test to pass in IE
169+
document.body.appendChild(vm.$el)
170+
168171
triggerEvent(vm.$el, 'click')
169172
expect(spyA.calls.count()).toBe(1)
170173
expect(spyB.calls.count()).toBe(0)
@@ -174,6 +177,7 @@ describe('Instance properties', () => {
174177
triggerEvent(vm.$el, 'click')
175178
expect(spyA.calls.count()).toBe(1)
176179
expect(spyB.calls.count()).toBe(1)
180+
document.body.removeChild(vm.$el)
177181
}).then(done)
178182
})
179183

Diff for: test/unit/modules/vdom/patch/hydration.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ describe('vdom patch: hydration', () => {
223223
expect(dom.innerHTML).toBe('<span>bar</span>')
224224
expect(dom.querySelector('span')).toBe(span)
225225
}).then(done)
226-
}, 0)
226+
}, 10)
227227
})
228228

229229
it('should hydrate async component without showing loading', done => {
@@ -256,7 +256,7 @@ describe('vdom patch: hydration', () => {
256256

257257
setTimeout(() => {
258258
expect(dom.innerHTML).toBe('<span>foo</span>')
259-
}, 1)
259+
}, 2)
260260

261261
setTimeout(() => {
262262
expect(dom.innerHTML).toBe('<span>foo</span>')
@@ -266,7 +266,7 @@ describe('vdom patch: hydration', () => {
266266
expect(dom.innerHTML).toBe('<span>bar</span>')
267267
expect(dom.querySelector('span')).toBe(span)
268268
}).then(done)
269-
}, 10)
269+
}, 50)
270270
})
271271

272272
it('should hydrate async component by replacing DOM if error occurs', done => {
@@ -295,6 +295,6 @@ describe('vdom patch: hydration', () => {
295295
expect('Failed to resolve async').toHaveBeenWarned()
296296
expect(dom.innerHTML).toBe('<span>error</span>')
297297
done()
298-
}, 10)
298+
}, 50)
299299
})
300300
})

0 commit comments

Comments
 (0)