mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
Add MenuControl tests
This commit is contained in:
@@ -14,12 +14,18 @@ class JobOutput extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<b>{job.name} - Heading and Job Stats placeholder</b> <br /> {/*Heading and Job Stats */}
|
<b>{job.name}</b>
|
||||||
<b>Host Status Bar placeholder</b> <br /> {/*Host Status Bar */}
|
{/*Heading and Job Stats */}
|
||||||
<OutputToolbar> {/* Filter and Pagination */}
|
{/*Host Status Bar */}
|
||||||
|
<OutputToolbar>
|
||||||
|
{/* Filter and Pagination */}
|
||||||
<b>Filter placeholder</b>
|
<b>Filter placeholder</b>
|
||||||
<MenuControls />
|
<MenuControls />
|
||||||
</OutputToolbar>
|
</OutputToolbar>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,29 +26,19 @@ class MenuControls extends Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Button
|
<Button variant="plain">
|
||||||
variant="plain"
|
|
||||||
>
|
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button variant="plain">
|
||||||
variant="plain"
|
|
||||||
>
|
|
||||||
<AngleUpIcon />
|
<AngleUpIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button variant="plain">
|
||||||
variant="plain"
|
|
||||||
>
|
|
||||||
<AngleDownIcon />
|
<AngleDownIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button variant="plain">
|
||||||
variant="plain"
|
|
||||||
>
|
|
||||||
<AngleDoubleUpIcon />
|
<AngleDoubleUpIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button variant="plain">
|
||||||
variant="plain"
|
|
||||||
>
|
|
||||||
<AngleDoubleDownIcon />
|
<AngleDoubleDownIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</Wrapper>
|
</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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user