From aaa16ae54a2ac0ebea55d929f2aaec6cde0b08af Mon Sep 17 00:00:00 2001 From: asmyshlyaev177 Date: Sat, 30 Nov 2024 03:08:11 +0400 Subject: [PATCH] test: fix test after last change --- .../useUrlStateBase/useUrlStateBase.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/urlstate/useUrlStateBase/useUrlStateBase.test.ts b/packages/urlstate/useUrlStateBase/useUrlStateBase.test.ts index 8f3cd56..c7bdfaf 100644 --- a/packages/urlstate/useUrlStateBase/useUrlStateBase.test.ts +++ b/packages/urlstate/useUrlStateBase/useUrlStateBase.test.ts @@ -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 () => { @@ -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 () => { @@ -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', {}); }); }); @@ -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', () => { @@ -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 () => { @@ -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); }); @@ -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); });