2016-10-17 18:55:03 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
import expect from 'expect';
|
|
|
|
|
import { mount } from 'enzyme';
|
|
|
|
|
|
2016-11-04 17:06:11 +00:00
|
|
|
import { EllipsisMenu } from './EllipsisMenu';
|
2016-10-17 18:55:03 +00:00
|
|
|
|
2016-11-04 17:06:11 +00:00
|
|
|
describe('EllipsisMenu - component', () => {
|
2016-10-17 18:55:03 +00:00
|
|
|
it('Displays children on click', () => {
|
|
|
|
|
const component = mount(
|
2016-11-04 17:06:11 +00:00
|
|
|
<EllipsisMenu>
|
|
|
|
|
<span>EllipsisMenu Children</span>
|
|
|
|
|
</EllipsisMenu>
|
2016-10-17 18:55:03 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
expect(component.state().showChildren).toEqual(false);
|
2016-11-04 17:06:11 +00:00
|
|
|
expect(component.text()).toNotContain('EllipsisMenu Children');
|
2016-10-17 18:55:03 +00:00
|
|
|
|
2016-10-21 23:13:41 +00:00
|
|
|
component.find('button').simulate('click');
|
2016-10-17 18:55:03 +00:00
|
|
|
|
|
|
|
|
expect(component.state().showChildren).toEqual(true);
|
2016-11-04 17:06:11 +00:00
|
|
|
expect(component.text()).toContain('EllipsisMenu Children');
|
2016-10-17 18:55:03 +00:00
|
|
|
});
|
|
|
|
|
});
|