mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Refactor breadcrumbs, tabs, routing.
* Cleanup previous params logic from Notificaitons list * Add shared breadcrumbs and tabs components * Structure Organization screens to render only cardBody content * Add styles * Fetch organization when location changes
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import OrganizationBreadcrumb from '../../../../src/pages/Organizations/components/OrganizationBreadcrumb';
|
||||
|
||||
describe('<OrganizationBreadcrumb />', () => {
|
||||
test('initially renders succesfully', () => {
|
||||
mount(
|
||||
<MemoryRouter initialEntries={['/organizations']} initialIndex={0}>
|
||||
<OrganizationBreadcrumb
|
||||
match={{ path: '/organizations', url: '/organizations' }}
|
||||
location={{ search: '', pathname: '/organizations' }}
|
||||
parentObj={[{ name: 'Organizations', url: '/organizations' }]}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -10,9 +10,8 @@ describe('<OrganizationDetail />', () => {
|
||||
<I18nProvider>
|
||||
<MemoryRouter initialEntries={['/organizations/1']} initialIndex={0}>
|
||||
<OrganizationDetail
|
||||
match={{ path: '/organizations/:id', url: '/organizations/1' }}
|
||||
location={{ search: '', pathname: '/organizations/1' }}
|
||||
params={{}}
|
||||
match={{ url: '/organizations/1' }}
|
||||
organization={{ name: 'Default' }}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import getTabName from '../../../src/pages/Organizations/utils';
|
||||
|
||||
describe('getTabName', () => {
|
||||
test('returns tab name', () => {
|
||||
expect(getTabName('details')).toBe('Details');
|
||||
expect(getTabName('access')).toBe('Access');
|
||||
expect(getTabName('teams')).toBe('Teams');
|
||||
expect(getTabName('notifications')).toBe('Notifications');
|
||||
expect(getTabName('unknown')).toBe('');
|
||||
expect(getTabName()).toBe('');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user