diff --git a/sdks/sdk-openint/src/index.spec.tsx b/sdks/sdk-openint/src/index.spec.ts similarity index 88% rename from sdks/sdk-openint/src/index.spec.tsx rename to sdks/sdk-openint/src/index.spec.ts index 40d7c3f..1010bcc 100644 --- a/sdks/sdk-openint/src/index.spec.tsx +++ b/sdks/sdk-openint/src/index.spec.ts @@ -1,3 +1,4 @@ +import {jest} from '@jest/globals' import createReactQuery from 'openapi-react-query' import {createQueryHook} from 'swr-openapi' import initOpenIntSDK from './index.js' @@ -31,18 +32,18 @@ test('openapi-react-query integration works', () => { expect(MyComponent).toBeTruthy() }) -test('swr-openapi integration does not work yet', () => { +test('swr-openapi integration', () => { const useQuery = createQueryHook(openint.fetchClient, 'openint-api') const MyComponent = () => { - const {data, error, isLoading} = useQuery('/core/connection/{id}') + const {data, error, isLoading} = useQuery('/core/connection/{id}', { + params: {path: {id: 'my-connection-id'}}, + }) if (isLoading || !data) return 'Loading...' if (error) return `An error occured: ${error}` - // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-unsafe-return return data.displayName }