Skip to content

Commit

Permalink
test(react-query): add test case for infiniteQueryOptions (#8268)
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli authored Nov 13, 2024
1 parent 6c9e3f3 commit c2b435d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/react-query/src/__tests__/infiniteQueryOptions.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest'

import { infiniteQueryOptions } from '../infiniteQueryOptions'
import type { UseInfiniteQueryOptions } from '../types'

describe('infiniteQueryOptions', () => {
it('should return the object received as a parameter without any modification.', () => {
const object: UseInfiniteQueryOptions = {
queryKey: ['key'],
queryFn: () => Promise.resolve(5),
getNextPageParam: () => null,
initialPageParam: null,
}

expect(infiniteQueryOptions(object)).toStrictEqual(object)
})
})

0 comments on commit c2b435d

Please sign in to comment.