Skip to content

Commit

Permalink
UISAUTHCOM-49 put regular role type when duplicating (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaSedyx authored Feb 26, 2025
1 parent 24013b4 commit 95ac15a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [UISAUTHCOM-44](https://folio-org.atlassian.net/browse/UISAUTHCOM-44) Add Deque Axe a11y tests.
* [UISAUTHCOM-47](https://folio-org.atlassian.net/browse/UISAUTHCOM-47) Retry get publication details request for `404` response status.
* [UISAUTHCOM-49](https://folio-org.atlassian.net/browse/UISAUTHCOM-49) put regular role type when duplicating.

## [1.0.1](https://github.com/folio-org/stripes-authorization-components/tree/v1.0.1) (2024-11-08)
[Full Changelog](https://github.com/folio-org/stripes-acq-components/compare/v1.0.0...v1.0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
useOkapiKy,
} from '@folio/stripes/core';

import { CAPABILITIES_LIMIT, ROLES_API } from '../../constants';
import {
CAPABILITIES_LIMIT,
ROLES_API,
ROLE_TYPE,
} from '../../constants';

const DEFAULT_VALUE = [];

Expand Down Expand Up @@ -68,6 +72,7 @@ export const useAuthorizationRolesMutation = (options = {}) => {
id: undefined,
name: getDuplicateRoleName({ name: role.name, intl }),
metadata: undefined,
type: ROLE_TYPE.regular,
}
}).json();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
import { renderHook, act } from '@folio/jest-config-stripes/testing-library/react';
import { useOkapiKy } from '@folio/stripes/core';

import { ROLE_TYPE } from '../../constants';
import { useAuthorizationRolesMutation } from './useAuthorizationRolesMutation';

const queryClient = new QueryClient();
Expand Down Expand Up @@ -68,7 +69,14 @@ describe('useAuthorizationRolesMutation', () => {
await act(async () => result.current.duplicateAuthorizationRole('1'));

expect(postMock).toHaveBeenCalledTimes(3);
expect(postMock.mock.calls[0][1]).toEqual({ 'json': { 'id': undefined, 'metadata': undefined, 'name': 'role stripes-authorization-components.crud.duplicate.suffix - duplicate' } });
expect(postMock.mock.calls[0][1]).toEqual({
json: {
id: undefined,
metadata: undefined,
name: 'role stripes-authorization-components.crud.duplicate.suffix - duplicate',
type: ROLE_TYPE.regular,
},
});
});

describe('when there is no `capability-sets` and `capabilities`', () => {
Expand Down

0 comments on commit 95ac15a

Please sign in to comment.