Skip to content

Commit 497d4ac

Browse files
test(useInfiniteQuery): adjust tests to pass for notifyOnChangeProps udpate
1 parent 74d72ed commit 497d4ac

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/reactjs/tests/useInfiniteQuery.test.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ describe('useInfiniteQuery', () => {
186186
{
187187
getNextPageParam: () => 1,
188188
keepPreviousData: true,
189+
notifyOnChangeProps: 'all',
189190
}
190191
)
191192

@@ -306,6 +307,7 @@ describe('useInfiniteQuery', () => {
306307
pages: [...data.pages].reverse(),
307308
pageParams: [...data.pageParams].reverse(),
308309
}),
310+
notifyOnChangeProps: 'all',
309311
}
310312
)
311313

@@ -359,6 +361,7 @@ describe('useInfiniteQuery', () => {
359361
},
360362
{
361363
getPreviousPageParam: firstPage => firstPage - 1,
364+
notifyOnChangeProps: 'all',
362365
}
363366
)
364367

@@ -423,8 +426,10 @@ describe('useInfiniteQuery', () => {
423426
const states: UseInfiniteQueryResult<number>[] = []
424427

425428
function Page() {
426-
const state = useInfiniteQuery(key, ({ pageParam = 10 }) =>
427-
Number(pageParam)
429+
const state = useInfiniteQuery(
430+
key,
431+
({ pageParam = 10 }) => Number(pageParam),
432+
{ notifyOnChangeProps: 'all' }
428433
)
429434

430435
states.push(state)
@@ -516,6 +521,7 @@ describe('useInfiniteQuery', () => {
516521
{
517522
getPreviousPageParam: firstPage => firstPage - 1,
518523
getNextPageParam: lastPage => lastPage + 1,
524+
notifyOnChangeProps: 'all',
519525
}
520526
)
521527

@@ -608,6 +614,7 @@ describe('useInfiniteQuery', () => {
608614
({ pageParam = 10 }) => Number(pageParam) * multiplier.current,
609615
{
610616
getNextPageParam: lastPage => lastPage + 1,
617+
notifyOnChangeProps: 'all',
611618
}
612619
)
613620

@@ -687,6 +694,7 @@ describe('useInfiniteQuery', () => {
687694
},
688695
{
689696
getNextPageParam: lastPage => lastPage + 1,
697+
notifyOnChangeProps: 'all',
690698
}
691699
)
692700

@@ -913,6 +921,7 @@ describe('useInfiniteQuery', () => {
913921
},
914922
{
915923
getNextPageParam: lastPage => lastPage + 1,
924+
notifyOnChangeProps: 'all',
916925
}
917926
)
918927

@@ -1014,6 +1023,7 @@ describe('useInfiniteQuery', () => {
10141023
},
10151024
{
10161025
getNextPageParam: lastPage => lastPage + 1,
1026+
notifyOnChangeProps: 'all',
10171027
}
10181028
)
10191029

@@ -1080,6 +1090,7 @@ describe('useInfiniteQuery', () => {
10801090
},
10811091
{
10821092
getNextPageParam: lastPage => lastPage + 1,
1093+
notifyOnChangeProps: 'all',
10831094
}
10841095
)
10851096

@@ -1169,6 +1180,7 @@ describe('useInfiniteQuery', () => {
11691180
{
11701181
initialData: { pages: [1], pageParams: [1] },
11711182
getNextPageParam: lastPage => lastPage + 1,
1183+
notifyOnChangeProps: 'all',
11721184
}
11731185
)
11741186

0 commit comments

Comments
 (0)