mirror of
https://github.com/ansible/awx.git
synced 2026-01-28 09:01:26 -03:30
* working: rename OrganizationTeamsList to PaginatedDataList * convert org notifications list fully to PaginatedDataList * update NotificationList tests * refactor org access to use PaginatedDataList * update tests for org access refactor; fix pagination & sorting * restore Add Role functionality to Org roles * fix displayed text when list of items is empty * preserve query params when navigating through pagination * fix bugs after RBAC rebase * fix lint errors, fix add org access button
38 lines
946 B
JavaScript
38 lines
946 B
JavaScript
import React from 'react';
|
|
import { mountWithContexts } from '../../../enzymeHelpers';
|
|
import OrganizationAccessItem from '../../../../src/pages/Organizations/components/OrganizationAccessItem';
|
|
|
|
const accessRecord = {
|
|
id: 2,
|
|
username: 'jane',
|
|
url: '/bar',
|
|
first_name: 'jane',
|
|
last_name: 'brown',
|
|
summary_fields: {
|
|
direct_access: [{
|
|
role: {
|
|
id: 3,
|
|
name: 'Member',
|
|
resource_name: 'Org',
|
|
resource_type: 'organization',
|
|
team_id: 5,
|
|
team_name: 'The Team',
|
|
user_capabilities: { unattach: true },
|
|
}
|
|
}],
|
|
indirect_access: [],
|
|
}
|
|
};
|
|
|
|
describe('<OrganizationAccessItem />', () => {
|
|
test('initially renders succesfully', () => {
|
|
const wrapper = mountWithContexts(
|
|
<OrganizationAccessItem
|
|
accessRecord={accessRecord}
|
|
onRoleDelete={() => {}}
|
|
/>
|
|
);
|
|
expect(wrapper.find('OrganizationAccessItem')).toMatchSnapshot();
|
|
});
|
|
});
|