mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 01:47:31 -02:30
update organizations structure and add unstyled sub routes and breadcrumbs
This commit is contained in:
24
__tests__/pages/Organizations/Organization.add.test.jsx
Normal file
24
__tests__/pages/Organizations/Organization.add.test.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { API_ORGANIZATIONS } from '../../../src/endpoints';
|
||||
import OrganizationAdd from '../../../src/pages/Organizations/Organization.add';
|
||||
|
||||
describe('<OrganizationAdd />', () => {
|
||||
let pageWrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
pageWrapper = mount(<OrganizationAdd />);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
pageWrapper.unmount();
|
||||
});
|
||||
|
||||
test('initially renders without crashing', () => {
|
||||
expect(pageWrapper.length).toBe(1);
|
||||
});
|
||||
|
||||
test('API Organization endpoint is valid', () => {
|
||||
expect(API_ORGANIZATIONS).toBeDefined();
|
||||
});
|
||||
});
|
||||
32
__tests__/pages/Organizations/Organization.view.test.jsx
Normal file
32
__tests__/pages/Organizations/Organization.view.test.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { mount } from 'enzyme';
|
||||
import { API_ORGANIZATIONS } from '../../../src/endpoints';
|
||||
import OrganizationView from '../../../src/pages/Organizations/Organization.view';
|
||||
|
||||
describe('<OrganizationView />', () => {
|
||||
let pageWrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
pageWrapper = mount(
|
||||
<MemoryRouter initialEntries={['/organizations/1']}>
|
||||
<OrganizationView
|
||||
match={{ path: '/organizations/:id', route: 'organizations/1', link: 'organizations', params: { id: '1' } }}
|
||||
location={{ search: '', pathname: '' }}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
pageWrapper.unmount();
|
||||
});
|
||||
|
||||
test('initially renders without crashing', () => {
|
||||
expect(pageWrapper.length).toBe(1);
|
||||
});
|
||||
|
||||
test('API Organization endpoint is valid', () => {
|
||||
expect(API_ORGANIZATIONS).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -3,9 +3,9 @@ import { HashRouter } from 'react-router-dom';
|
||||
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import api from '../../src/api';
|
||||
import { API_ORGANIZATIONS } from '../../src/endpoints';
|
||||
import Organizations from '../../src/pages/Organizations';
|
||||
import api from '../../../src/api';
|
||||
import { API_ORGANIZATIONS } from '../../../src/endpoints';
|
||||
import Organizations from '../../../src/pages/Organizations';
|
||||
|
||||
describe('<Organizations />', () => {
|
||||
let pageWrapper;
|
||||
Reference in New Issue
Block a user