From c2b435dcd91a7df248ac5d6d6b928f4bea79b2b6 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Wed, 13 Nov 2024 16:05:42 +0900 Subject: [PATCH] test(react-query): add test case for infiniteQueryOptions (#8268) --- .../src/__tests__/infiniteQueryOptions.test.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/react-query/src/__tests__/infiniteQueryOptions.test.tsx diff --git a/packages/react-query/src/__tests__/infiniteQueryOptions.test.tsx b/packages/react-query/src/__tests__/infiniteQueryOptions.test.tsx new file mode 100644 index 0000000000..3e876fd5d0 --- /dev/null +++ b/packages/react-query/src/__tests__/infiniteQueryOptions.test.tsx @@ -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) + }) +})