-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from folio-org/UITEN-306
UITEN-306: Fix saving problem for routing service point(ECS only)
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/hooks/useCirculationSettingsEcsTlrFeature/useCirculationSettingsEcsTlrFeature.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
QueryClient, | ||
QueryClientProvider, | ||
} from 'react-query'; | ||
import { | ||
renderHook, | ||
act, | ||
} from '@testing-library/react-hooks'; | ||
|
||
import { useOkapiKy } from '@folio/stripes/core'; | ||
|
||
import useCirculationSettingsEcsTlrFeature from './useCirculationSettingsEcsTlrFeature'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
// eslint-disable-next-line react/prop-types | ||
const wrapper = ({ children }) => ( | ||
<QueryClientProvider client={queryClient}> | ||
{children} | ||
</QueryClientProvider> | ||
); | ||
|
||
const data = 'data'; | ||
|
||
describe('useCirculationSettingsEcsTlrFeature', () => { | ||
it('should fetch data', async () => { | ||
useOkapiKy.mockClear().mockReturnValue({ | ||
get: () => ({ | ||
json: () => ({ | ||
data, | ||
}), | ||
}), | ||
}); | ||
|
||
const { result } = renderHook(() => useCirculationSettingsEcsTlrFeature(true), { wrapper }); | ||
|
||
await act(() => { | ||
return !result.current.isLoading; | ||
}); | ||
|
||
expect(result.current.titleLevelRequestsFeatureEnabled).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters