File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,13 @@ export const useFilter = ({
57
57
const update = ( newValues : string | FilterValues ) => {
58
58
const serialized =
59
59
typeof newValues === "string" ? newValues : stringifyFilter ( newValues ) ;
60
- const noUpdateNeeded = searchParams . get ( useFilterParamsKey ) === serialized ;
60
+ const noUpdateNeeded = query === serialized ;
61
61
if ( noUpdateNeeded ) {
62
62
return ;
63
63
}
64
64
65
- const copy = new URLSearchParams ( searchParams ) ;
66
- copy . set ( useFilterParamsKey , serialized ) ;
67
- onSearchParamsChange ( copy ) ;
65
+ searchParams . set ( useFilterParamsKey , serialized ) ;
66
+ onSearchParamsChange ( searchParams ) ;
68
67
onUpdate ?.( serialized ) ;
69
68
} ;
70
69
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
import { server } from "testHelpers/server" ;
16
16
import * as CreateDayString from "utils/createDayString" ;
17
17
import AuditPage from "./AuditPage" ;
18
+ import type { AuditLogsRequest } from "api/typesGenerated" ;
18
19
19
20
interface RenderPageOptions {
20
21
filter ?: string ;
@@ -106,7 +107,7 @@ describe("AuditPage", () => {
106
107
await userEvent . type ( filterField , query ) ;
107
108
108
109
await waitFor ( ( ) =>
109
- expect ( getAuditLogsSpy ) . toBeCalledWith ( {
110
+ expect ( getAuditLogsSpy ) . toHaveBeenCalledWith < [ AuditLogsRequest ] > ( {
110
111
limit : DEFAULT_RECORDS_PER_PAGE ,
111
112
offset : 0 ,
112
113
q : query ,
You can’t perform that action at this time.
0 commit comments