Skip to content

Commit

Permalink
Update useAuthorizationRolesMutation.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaSedyx authored Feb 26, 2025
1 parent 4d41a8c commit 4bf0bc5
Showing 1 changed file with 9 additions and 1 deletion.
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 4bf0bc5

Please sign in to comment.