You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnewURLSearchParams(router.asPath);// use asPath to get the url as set by our implementation, using router.query or router.search return multivalues in a different format than the actual url
21
-
};
8
+
describe('usePageQueryParams',()=>{
9
+
constoriginalWindowLocation=window.location;
10
+
beforeEach(()=>{
11
+
jest.resetAllMocks();
12
+
});
22
13
23
-
return{
24
-
useRouter,
25
-
usePathname,
26
-
useSearchParams,
27
-
};
28
-
});
14
+
afterEach(()=>{
15
+
Object.defineProperty(window,'location',{
16
+
value: originalWindowLocation,
17
+
writable: true,
18
+
});
19
+
});
29
20
30
-
describe('usePageQueryParams',()=>{
31
21
it('should return default values when search is empty',()=>{
32
22
const{ result }=renderHook(()=>usePageQueryParams(queryParamsConfig));
0 commit comments