Skip to content

Commit

Permalink
test(useInfiniteQuery): adjust tests to pass for notifyOnChangeProps …
Browse files Browse the repository at this point in the history
…udpate
  • Loading branch information
babycourageous committed Nov 19, 2021
1 parent 74d72ed commit 497d4ac
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/reactjs/tests/useInfiniteQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ describe('useInfiniteQuery', () => {
{
getNextPageParam: () => 1,
keepPreviousData: true,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -306,6 +307,7 @@ describe('useInfiniteQuery', () => {
pages: [...data.pages].reverse(),
pageParams: [...data.pageParams].reverse(),
}),
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -359,6 +361,7 @@ describe('useInfiniteQuery', () => {
},
{
getPreviousPageParam: firstPage => firstPage - 1,
notifyOnChangeProps: 'all',
}
)

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

function Page() {
const state = useInfiniteQuery(key, ({ pageParam = 10 }) =>
Number(pageParam)
const state = useInfiniteQuery(
key,
({ pageParam = 10 }) => Number(pageParam),
{ notifyOnChangeProps: 'all' }
)

states.push(state)
Expand Down Expand Up @@ -516,6 +521,7 @@ describe('useInfiniteQuery', () => {
{
getPreviousPageParam: firstPage => firstPage - 1,
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -608,6 +614,7 @@ describe('useInfiniteQuery', () => {
({ pageParam = 10 }) => Number(pageParam) * multiplier.current,
{
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -687,6 +694,7 @@ describe('useInfiniteQuery', () => {
},
{
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -913,6 +921,7 @@ describe('useInfiniteQuery', () => {
},
{
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -1014,6 +1023,7 @@ describe('useInfiniteQuery', () => {
},
{
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -1080,6 +1090,7 @@ describe('useInfiniteQuery', () => {
},
{
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down Expand Up @@ -1169,6 +1180,7 @@ describe('useInfiniteQuery', () => {
{
initialData: { pages: [1], pageParams: [1] },
getNextPageParam: lastPage => lastPage + 1,
notifyOnChangeProps: 'all',
}
)

Expand Down

0 comments on commit 497d4ac

Please sign in to comment.