Skip to content

Commit

Permalink
fix(router.go): replace/push history with object that reset the searc…
Browse files Browse the repository at this point in the history
…h value if target is object
  • Loading branch information
BensonLiao committed Dec 3, 2020
1 parent 7733318 commit 3f85e86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions __tests__/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test('Going to a page with a route name will push the history state.', () => {
params: {userId: 'AWgrmJp1SjjuUM2bzZXM', index: 0}
});
expect(router.history.push).toBeCalledWith(
'/users/AWgrmJp1SjjuUM2bzZXM/projects?index=0',
{pathname: '/users/AWgrmJp1SjjuUM2bzZXM/projects?index=0', search: ''},
{
name: 'projects',
params: {index: 0, userId: 'AWgrmJp1SjjuUM2bzZXM'}
Expand All @@ -87,7 +87,7 @@ test('Replace a page with a route name.', () => {
{replace: true}
);
expect(router.history.replace).toBeCalledWith(
'/users/AWgrmJp1SjjuUM2bzZXM/projects?index=0',
{pathname: '/users/AWgrmJp1SjjuUM2bzZXM/projects?index=0', search: ''},
{
name: 'projects',
params: {index: 0, userId: 'AWgrmJp1SjjuUM2bzZXM'}
Expand Down
Loading

0 comments on commit 3f85e86

Please sign in to comment.