mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 06:51:10 +03:00
Add MenuControl tests
This commit is contained in:
parent
408b38174a
commit
859c364fbe
@ -14,12 +14,18 @@ class JobOutput extends Component {
|
||||
|
||||
return (
|
||||
<CardBody>
|
||||
<b>{job.name} - Heading and Job Stats placeholder</b> <br /> {/*Heading and Job Stats */}
|
||||
<b>Host Status Bar placeholder</b> <br /> {/*Host Status Bar */}
|
||||
<OutputToolbar> {/* Filter and Pagination */}
|
||||
<b>{job.name}</b>
|
||||
{/*Heading and Job Stats */}
|
||||
{/*Host Status Bar */}
|
||||
<OutputToolbar>
|
||||
{/* Filter and Pagination */}
|
||||
<b>Filter placeholder</b>
|
||||
<MenuControls />
|
||||
</OutputToolbar>
|
||||
<ul>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
</CardBody>
|
||||
);
|
||||
}
|
||||
|
@ -26,29 +26,19 @@ class MenuControls extends Component {
|
||||
render() {
|
||||
return (
|
||||
<Wrapper>
|
||||
<Button
|
||||
variant="plain"
|
||||
>
|
||||
<Button variant="plain">
|
||||
<PlusIcon />
|
||||
</Button>
|
||||
<Button
|
||||
variant="plain"
|
||||
>
|
||||
<Button variant="plain">
|
||||
<AngleUpIcon />
|
||||
</Button>
|
||||
<Button
|
||||
variant="plain"
|
||||
>
|
||||
<Button variant="plain">
|
||||
<AngleDownIcon />
|
||||
</Button>
|
||||
<Button
|
||||
variant="plain"
|
||||
>
|
||||
<Button variant="plain">
|
||||
<AngleDoubleUpIcon />
|
||||
</Button>
|
||||
<Button
|
||||
variant="plain"
|
||||
>
|
||||
<Button variant="plain">
|
||||
<AngleDoubleDownIcon />
|
||||
</Button>
|
||||
</Wrapper>
|
||||
|
@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import MenuControls from './MenuControls';
|
||||
|
||||
let wrapper;
|
||||
let PlusIcon;
|
||||
let AngleDoubleUpIcon;
|
||||
let AngleDoubleDownIcon;
|
||||
let AngleUpIcon;
|
||||
let AngleDownIcon;
|
||||
|
||||
const findChildren = () => {
|
||||
PlusIcon = wrapper.find('PlusIcon');
|
||||
AngleDoubleUpIcon = wrapper.find('AngleDoubleUpIcon');
|
||||
AngleDoubleDownIcon = wrapper.find('AngleDoubleDownIcon');
|
||||
AngleUpIcon = wrapper.find('AngleUpIcon');
|
||||
AngleDownIcon = wrapper.find('AngleDownIcon');
|
||||
}
|
||||
|
||||
describe('MenuControls', () => {
|
||||
test('should render successfully', () => {
|
||||
wrapper = mount(<MenuControls />);
|
||||
expect(wrapper).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('should render menu control icons', () => {
|
||||
wrapper = mount(<MenuControls />);
|
||||
findChildren();
|
||||
expect(PlusIcon.length).toBe(1);
|
||||
expect(AngleDoubleUpIcon.length).toBe(1);
|
||||
expect(AngleDoubleDownIcon.length).toBe(1);
|
||||
expect(AngleUpIcon.length).toBe(1);
|
||||
expect(AngleDownIcon.length).toBe(1);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user