Skip to content

Commit

Permalink
Add tests for query and state props on Links.
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Oct 9, 2015
1 parent 42891a2 commit e7c6f3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/__tests__/Link-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ describe('A <Link>', function () {
// just here to make sure click handlers don't prevent it from happening
}
render() {
return <Link to="/hello" hash="#world" onClick={(e) => this.handleClick(e)}>Link</Link>
return <Link to="/hello" hash="#world" query={{ how: 'are' }} state={{ you: 'doing?' }} onClick={(e) => this.handleClick(e)}>Link</Link>
}
}

Expand All @@ -302,7 +302,7 @@ describe('A <Link>', function () {
},
function () {
expect(node.innerHTML).toMatch(/Hello/)
expect(spy).toHaveBeenCalledWith(undefined, '/hello#world')
expect(spy).toHaveBeenCalledWith({ you: 'doing?' }, '/hello#world?how=are')

This comment has been minimized.

Copy link
@mjackson

mjackson Oct 9, 2015

Member

This URL should be /hello?how=are#world. The hash needs to come after the query string.

This comment has been minimized.

Copy link
@timdorr

timdorr Oct 9, 2015

Author Member

Yes, that's a bug with history

}
]

Expand Down

0 comments on commit e7c6f3d

Please sign in to comment.