Skip to content

Commit

Permalink
test: fix test after last change
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Nov 29, 2024
1 parent 8d27ba1 commit aaa16ae
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/urlstate/useUrlStateBase/useUrlStateBase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('useUrlStateBase', () => {

expect(result.current.state).toStrictEqual({ ...shape, num: 50 });
expect(router.push).toHaveBeenCalledTimes(1);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', undefined);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', {});
});

test('partial shape', async () => {
Expand All @@ -262,7 +262,7 @@ describe('useUrlStateBase', () => {

expect(result.current.state).toStrictEqual({ ...shape, num: 50 });
expect(router.push).toHaveBeenCalledTimes(1);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', undefined);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', {});
});

test('no arg, should reset', async () => {
Expand All @@ -283,7 +283,7 @@ describe('useUrlStateBase', () => {

expect(result.current.state).toStrictEqual({ ...shape, num: 50 });
expect(router.push).toHaveBeenCalledTimes(1);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', undefined);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', {});
});
});

Expand All @@ -302,7 +302,7 @@ describe('useUrlStateBase', () => {

expect(result.current.state).toStrictEqual({ ...shape, num: 50 });
expect(router.push).toHaveBeenCalledTimes(1);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', undefined);
expect(router.push).toHaveBeenNthCalledWith(1, '/?num=50', {});
});

test('do not update if url same', () => {
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('useUrlStateBase', () => {
await vi.advanceTimersByTime(700);

expect(router.push).toHaveBeenCalledTimes(1);
expect(router.push).toHaveBeenNthCalledWith(1, `/?num=55${hash}`, undefined);
expect(router.push).toHaveBeenNthCalledWith(1, `/?num=55${hash}`, {});
});

test('replace and options', async () => {
Expand Down Expand Up @@ -458,7 +458,7 @@ describe('useUrlStateBase', () => {

expect(router.replace).not.toHaveBeenCalled()
expect(router.push).toHaveBeenCalledTimes(2)
expect(router.push).toHaveBeenLastCalledWith('/', undefined)
expect(router.push).toHaveBeenLastCalledWith('/', {})

expect(result.current.state).toStrictEqual(shape);
});
Expand Down Expand Up @@ -486,7 +486,7 @@ describe('useUrlStateBase', () => {

expect(router.replace).not.toHaveBeenCalled()
expect(router.push).toHaveBeenCalledTimes(1)
expect(router.push).toHaveBeenLastCalledWith('/', undefined)
expect(router.push).toHaveBeenLastCalledWith('/', {})
expect(result.current.state).toStrictEqual(shape);
});

Expand Down

0 comments on commit aaa16ae

Please sign in to comment.