Skip to content

Commit 6d5fdef

Browse files
committed
Fix broken tests.
1 parent 2f38983 commit 6d5fdef

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

modules/__tests__/Link-test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,21 @@ describe('A <Link>', function () {
289289
}
290290

291291
const history = createHistory('/')
292-
const spy = spyOn(history, 'pushState').andCallThrough()
292+
const spy = spyOn(history, 'push').andCallThrough()
293293

294294
const steps = [
295295
function () {
296296
click(node.querySelector('a'), { button: 0 })
297297
},
298298
function () {
299299
expect(node.innerHTML).toMatch(/Hello/)
300-
expect(spy).toHaveBeenCalledWith({ you: 'doing?' }, { pathname: '/hello', search: '?how=are', hash: '#world' })
300+
expect(spy).toHaveBeenCalled()
301+
302+
const { location } = this.state
303+
expect(location.pathname).toEqual('/hello')
304+
expect(location.search).toEqual('?how=are')
305+
expect(location.hash).toEqual('#world')
306+
expect(location.state).toEqual({ you: 'doing?' })
301307
}
302308
]
303309

modules/__tests__/isActive-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ describe('isActive', function () {
390390
describe('with query that does match', function () {
391391
it('is active', function (done) {
392392
render((
393-
<Router history={createHistory('/home?foo[]=bar&foo[]=bar1&foo[]=bar2')}>
393+
<Router history={createHistory('/home?foo=bar&foo=bar1&foo=bar2')}>
394394
<Route path="/" />
395395
<Route path="/home" />
396396
</Router>

0 commit comments

Comments
 (0)