Skip to content

Commit

Permalink
Merge pull request #422 from folio-org/UITEN-306
Browse files Browse the repository at this point in the history
UITEN-306: Fix saving problem for routing service point(ECS only)
  • Loading branch information
Dmitriy-Litvinenko authored Sep 5, 2024
2 parents 3045222 + 31247b4 commit 3cfaad2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [UITEN-299](https://folio-org.atlassian.net/browse/UITEN-299) Rewrite class components to functional ones (ui-tenant-settings module).
* [UITEN-292](https://folio-org.atlassian.net/browse/UITEN-292) Change visibility rules for routing service points.
* [UITEN-304](https://folio-org.atlassian.net/browse/UITEN-304) Provide case insensitive sorted data to edit record, field components.
* [UITEN-306](https://folio-org.atlassian.net/browse/UITEN-306) Fix saving problem for routing service point(ECS only).

## [8.1.0](https://github.com/folio-org/ui-tenant-settings/tree/v8.1.0)(2024-03-19)
[Full Changelog](https://github.com/folio-org/ui-tenant-settings/compare/v8.0.0...v8.1.0)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"@testing-library/dom": "^7.26.3",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^11.0.2",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/user-event": "^12.1.10",
"babel-eslint": "^9.0.0",
"babel-jest": "^26.3.0",
Expand Down
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();
});
});
1 change: 1 addition & 0 deletions src/settings/ServicePoints/ServicePointFormContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const ServicePointFormContainer = ({
}

if (data.ecsRequestRouting) {
unset(data, 'shelvingLagTime');
unset(data, 'pickupLocation');
unset(data, 'holdShelfExpiryPeriod');
unset(data, 'holdShelfClosedLibraryDateManagement');
Expand Down

0 comments on commit 3cfaad2

Please sign in to comment.