Skip to content

Commit

Permalink
test: make tests pass in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 12, 2017
1 parent 91deb4f commit 485e740
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/unit/features/component/component-async.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ describe('Component async', () => {
expect(vm.$el.textContent).toBe('hi')
expect(`Failed to resolve async component`).not.toHaveBeenWarned()
done()
}, 30)
}, 50)
})
})
})
4 changes: 4 additions & 0 deletions test/unit/features/instance/properties.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ describe('Instance properties', () => {
}
}).$mount()

// has to be in dom for test to pass in IE
document.body.appendChild(vm.$el)

triggerEvent(vm.$el, 'click')
expect(spyA.calls.count()).toBe(1)
expect(spyB.calls.count()).toBe(0)
Expand All @@ -174,6 +177,7 @@ describe('Instance properties', () => {
triggerEvent(vm.$el, 'click')
expect(spyA.calls.count()).toBe(1)
expect(spyB.calls.count()).toBe(1)
document.body.removeChild(vm.$el)
}).then(done)
})

Expand Down
8 changes: 4 additions & 4 deletions test/unit/modules/vdom/patch/hydration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('vdom patch: hydration', () => {
expect(dom.innerHTML).toBe('<span>bar</span>')
expect(dom.querySelector('span')).toBe(span)
}).then(done)
}, 0)
}, 10)
})

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

setTimeout(() => {
expect(dom.innerHTML).toBe('<span>foo</span>')
}, 1)
}, 2)

setTimeout(() => {
expect(dom.innerHTML).toBe('<span>foo</span>')
Expand All @@ -266,7 +266,7 @@ describe('vdom patch: hydration', () => {
expect(dom.innerHTML).toBe('<span>bar</span>')
expect(dom.querySelector('span')).toBe(span)
}).then(done)
}, 10)
}, 50)
})

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

0 comments on commit 485e740

Please sign in to comment.