mirror of
https://github.com/ansible/awx.git
synced 2026-05-22 08:17:39 -02:30
Fix existing test failures
This commit is contained in:
@@ -3,8 +3,12 @@ import { mountWithContexts } from '../../../../enzymeHelpers';
|
||||
import OrganizationAccess from '../../../../../src/pages/Organizations/screens/Organization/OrganizationAccess';
|
||||
|
||||
describe('<OrganizationAccess />', () => {
|
||||
const organization = {
|
||||
id: 1,
|
||||
name: 'Default'
|
||||
};
|
||||
test('initially renders succesfully', () => {
|
||||
mountWithContexts(<OrganizationAccess />);
|
||||
mountWithContexts(<OrganizationAccess organization={organization} />);
|
||||
});
|
||||
|
||||
test('passed methods as props are called appropriately', async () => {
|
||||
@@ -14,13 +18,14 @@ describe('<OrganizationAccess />', () => {
|
||||
const mockResponse = {
|
||||
status: 'success',
|
||||
};
|
||||
const wrapper = mountWithContexts(<OrganizationAccess />, { context: { network: {
|
||||
api: {
|
||||
getOrganizationAccessList: () => Promise.resolve(mockAPIAccessList),
|
||||
disassociate: () => Promise.resolve(mockResponse)
|
||||
},
|
||||
handleHttpError: () => {}
|
||||
} } }).find('OrganizationAccess');
|
||||
const wrapper = mountWithContexts(<OrganizationAccess organization={organization} />,
|
||||
{ context: { network: {
|
||||
api: {
|
||||
getOrganizationAccessList: () => Promise.resolve(mockAPIAccessList),
|
||||
disassociate: () => Promise.resolve(mockResponse)
|
||||
},
|
||||
handleHttpError: () => {}
|
||||
} } }).find('OrganizationAccess');
|
||||
const accessList = await wrapper.instance().getOrgAccessList();
|
||||
expect(accessList).toEqual(mockAPIAccessList);
|
||||
const resp = await wrapper.instance().removeRole(2, 3, 'users');
|
||||
|
||||
Reference in New Issue
Block a user