mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 22:19:28 -02:30
Respond to PR feedback.
This commit is contained in:
@@ -7,18 +7,11 @@ import OrganizationAccess from '../../../../../src/pages/Organizations/screens/O
|
||||
const mockAPIAccessList = {
|
||||
foo: 'bar',
|
||||
};
|
||||
const mockAPIRoles = {
|
||||
bar: 'baz',
|
||||
};
|
||||
|
||||
const mockGetOrganzationAccessList = jest.fn(() => (
|
||||
Promise.resolve(mockAPIAccessList)
|
||||
));
|
||||
|
||||
const mockGetUserRoles = jest.fn(() => (
|
||||
Promise.resolve(mockAPIRoles)
|
||||
));
|
||||
|
||||
describe('<OrganizationAccess />', () => {
|
||||
test('initially renders succesfully', () => {
|
||||
mount(
|
||||
@@ -29,7 +22,6 @@ describe('<OrganizationAccess />', () => {
|
||||
params={{}}
|
||||
api={{
|
||||
getOrganzationAccessList: jest.fn(),
|
||||
getUserRoles: jest.fn(),
|
||||
}}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
@@ -45,14 +37,11 @@ describe('<OrganizationAccess />', () => {
|
||||
params={{}}
|
||||
api={{
|
||||
getOrganzationAccessList: mockGetOrganzationAccessList,
|
||||
getUserRoles: mockGetUserRoles,
|
||||
}}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
).find('OrganizationAccess');
|
||||
const accessList = await wrapper.instance().getOrgAccessList();
|
||||
expect(accessList).toEqual(mockAPIAccessList);
|
||||
const userRoles = await wrapper.instance().getUserRoles();
|
||||
expect(userRoles).toEqual(mockAPIRoles);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user