Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
openint-bot committed Dec 23, 2024
1 parent 0092a5c commit a185e73
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit a185e73

Please sign in to comment.