1
0
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:
Marliana Lara 2019-07-11 10:46:46 -04:00
parent 408b38174a
commit 859c364fbe
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 49 additions and 18 deletions

View File

@ -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>
);
}

View File

@ -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>

View File

@ -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);
});
});