mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 23:24:48 -03:30
Remove unwanted committed file
This commit is contained in:
@@ -1,20 +1,64 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
<<<<<<< HEAD
|
||||
import { MemoryRouter } from 'react-router-dom'; import { MemoryRouter } from 'react-router-dom';
|
||||
import { I18nProvider } from '@lingui/react'; import { I18nProvider } from '@lingui/react';
|
||||
import Organization from '../../../../../src/pages/Organizations/screens/Organization/Organization'; import Organization, { _Organization } from '../../../../../src/pages/Organizations/screens/Organization/Organization';
|
||||
|
||||
=======
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { I18nProvider } from '@lingui/react';
|
||||
import Organization from '../../../../../src/pages/Organizations/screens/Organization/Organization';
|
||||
import Organization, { _Organization } from '../../../../../src/pages/Organizations/screens/Organization/Organization';
|
||||
>>>>>>> addresses PR issues
|
||||
|
||||
describe('<OrganizationView />', () => {
|
||||
test('initially renders succesfully', () => {
|
||||
const spy = jest.spyOn(_Organization.prototype, 'checkLocation');
|
||||
mount(
|
||||
<I18nProvider>
|
||||
<MemoryRouter initialEntries={['/organizations/1']} initialIndex={0}>
|
||||
<Organization
|
||||
<_Organization
|
||||
match={{ path: '/organizations/:id', url: '/organizations/1' }}
|
||||
location={{ search: '', pathname: '/organizations/1' }}
|
||||
/>
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
);
|
||||
expect(spy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('handleTabSelect renders the correct tab', async () => {
|
||||
const currentTab = 'organizations/19/access';
|
||||
const spy = jest.spyOn(_Organization.prototype, 'handleTabSelect');
|
||||
const wrapper = mount(
|
||||
<I18nProvider>
|
||||
<MemoryRouter initialEntries={['/organizations/1']} initialIndex={0}>
|
||||
<Organization location={currentTab} />
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
).find('Organization');
|
||||
wrapper.find('button').at(2).simulate('click');
|
||||
setImmediate(async () => {
|
||||
wrapper.setState({ activeTabKey: 1 });
|
||||
});
|
||||
wrapper.update();
|
||||
expect(spy).toBeCalled();
|
||||
expect(wrapper.state('activeTabKey')).toBe(1);
|
||||
});
|
||||
|
||||
test('checkLocation renders proper state when new tab is selected', async () => {
|
||||
const currentTab = 'organizations/19/access';
|
||||
const wrapper = mount(
|
||||
<I18nProvider>
|
||||
<MemoryRouter initialEntries={['/organizations/1']} initialIndex={0}>
|
||||
<Organization location={currentTab} />
|
||||
</MemoryRouter>
|
||||
</I18nProvider>
|
||||
).find('Organization');
|
||||
setImmediate(async () => {
|
||||
wrapper.setState({ activeTabKey: 1 });
|
||||
});
|
||||
wrapper.find('button').at(3).simulate('click');
|
||||
expect(wrapper.state('activeTabKey')).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user