Renames files to match the tabs better.

This commit is contained in:
Alex Corey 2020-07-28 13:25:46 -04:00
parent 8e27e0ce28
commit 24acacbcb6
7 changed files with 23 additions and 23 deletions

View File

@ -16,7 +16,7 @@ import ContentError from '../../components/ContentError';
import TeamDetail from './TeamDetail';
import TeamEdit from './TeamEdit';
import { TeamsAPI } from '../../api';
import TeamAccessList from './TeamAccess';
import TeamAccessList from './TeamRoles';
import { ResourceAccessList } from '../../components/ResourceAccessList';
function Team({ i18n, setBreadcrumb }) {

View File

@ -1 +0,0 @@
export { default } from './TeamAccessList';

View File

@ -11,7 +11,7 @@ import { Link } from 'react-router-dom';
import { DetailList, Detail } from '../../../components/DetailList';
import DataListCell from '../../../components/DataListCell';
function TeamAccessListItem({ role, i18n, detailUrl, onSelect }) {
function TeamRoleListItem({ role, i18n, detailUrl, onSelect }) {
const labelId = `teamRole-${role.id}`;
return (
<DataListItem key={role.id} aria-labelledby={labelId} id={`${role.id}`}>
@ -60,4 +60,4 @@ function TeamAccessListItem({ role, i18n, detailUrl, onSelect }) {
</DataListItem>
);
}
export default withI18n()(TeamAccessListItem);
export default withI18n()(TeamRoleListItem);

View File

@ -1,8 +1,8 @@
import React from 'react';
import { mountWithContexts } from '../../../../testUtils/enzymeHelpers';
import TeamAccessListItem from './TeamAccessListItem';
import TeamRoleListItem from './TeamRoleListItem';
describe('<TeamAccessListItem/>', () => {
describe('<TeamRoleListItem/>', () => {
let wrapper;
const role = {
id: 1,
@ -20,7 +20,7 @@ describe('<TeamAccessListItem/>', () => {
test('should mount properly', () => {
wrapper = mountWithContexts(
<TeamAccessListItem
<TeamRoleListItem
role={role}
detailUrl="/templates/job_template/15/details"
/>
@ -31,7 +31,7 @@ describe('<TeamAccessListItem/>', () => {
test('should render proper list item data', () => {
wrapper = mountWithContexts(
<TeamAccessListItem
<TeamRoleListItem
role={role}
detailUrl="/templates/job_template/15/details"
/>
@ -49,7 +49,7 @@ describe('<TeamAccessListItem/>', () => {
});
test('should render deletable chip', () => {
wrapper = mountWithContexts(
<TeamAccessListItem
<TeamRoleListItem
role={role}
detailUrl="/templates/job_template/15/details"
/>
@ -59,7 +59,7 @@ describe('<TeamAccessListItem/>', () => {
test('should render read only chip', () => {
role.summary_fields.user_capabilities.unattach = false;
wrapper = mountWithContexts(
<TeamAccessListItem
<TeamRoleListItem
role={role}
detailUrl="/templates/job_template/15/details"
/>

View File

@ -19,7 +19,7 @@ import PaginatedDataList from '../../../components/PaginatedDataList';
import { getQSConfig, parseQueryString } from '../../../util/qs';
import ErrorDetail from '../../../components/ErrorDetail';
import AlertModal from '../../../components/AlertModal';
import TeamAccessListItem from './TeamAccessListItem';
import TeamRoleListItem from './TeamRoleListItem';
import UserAndTeamAccessAdd from '../../../components/UserAndTeamAccessAdd/UserAndTeamAccessAdd';
const QS_CONFIG = getQSConfig('roles', {
@ -28,7 +28,7 @@ const QS_CONFIG = getQSConfig('roles', {
order_by: 'id',
});
function TeamAccessList({ i18n }) {
function TeamRolesList({ i18n }) {
const [isWizardOpen, setIsWizardOpen] = useState(false);
const { search } = useLocation();
const { id } = useParams();
@ -165,7 +165,7 @@ function TeamAccessList({ i18n }) {
/>
)}
renderItem={role => (
<TeamAccessListItem
<TeamRoleListItem
key={role.id}
role={role}
detailUrl={detailUrl(role)}
@ -234,4 +234,4 @@ function TeamAccessList({ i18n }) {
</>
);
}
export default withI18n()(TeamAccessList);
export default withI18n()(TeamRolesList);

View File

@ -5,7 +5,7 @@ import {
mountWithContexts,
waitForElement,
} from '../../../../testUtils/enzymeHelpers';
import TeamAccessList from './TeamAccessList';
import TeamRolesList from './TeamRolesList';
jest.mock('../../../api/models/Teams');
jest.mock('../../../api/models/Roles');
@ -92,7 +92,7 @@ const roles = {
const options = {
data: { actions: { POST: { id: 1, disassociate: true } } },
};
describe('<TeamAccessList />', () => {
describe('<TeamRolesList />', () => {
let wrapper;
afterEach(() => {
@ -104,9 +104,9 @@ describe('<TeamAccessList />', () => {
TeamsAPI.readRoleOptions.mockResolvedValue(options);
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
expect(wrapper.find('TeamAccessList').length).toBe(1);
expect(wrapper.find('TeamRolesList').length).toBe(1);
});
test('should create proper detailUrl', async () => {
@ -114,7 +114,7 @@ describe('<TeamAccessList />', () => {
TeamsAPI.readRoleOptions.mockResolvedValue(options);
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
@ -161,7 +161,7 @@ describe('<TeamAccessList />', () => {
},
});
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
@ -175,7 +175,7 @@ describe('<TeamAccessList />', () => {
TeamsAPI.readRoleOptions.mockResolvedValue(options);
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
@ -228,7 +228,7 @@ describe('<TeamAccessList />', () => {
TeamsAPI.readRoleOptions.mockResolvedValue(options);
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
@ -285,7 +285,7 @@ describe('<TeamAccessList />', () => {
TeamsAPI.readRoleOptions.mockResolvedValue(options);
await act(async () => {
wrapper = mountWithContexts(<TeamAccessList />);
wrapper = mountWithContexts(<TeamRolesList />);
});
waitForElement(

View File

@ -0,0 +1 @@
export { default } from './TeamRolesList';