Skip to content

Commit

Permalink
one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
VNadygin committed May 8, 2018
1 parent ca29ce2 commit a3d6280
Show file tree
Hide file tree
Showing 2 changed files with 9,528 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/reactackle-accordion/__tests__/accordion.test.js
Expand Up @@ -3,6 +3,7 @@ import renderer from 'react-test-renderer';
import toJson from 'enzyme-to-json';
import { mount } from 'enzyme';
import { Accordion, AccordionItem } from '../src';
import { TitleBoxStyled } from '../src/AccordionItem/styles';

const items = [
{
Expand Down Expand Up @@ -67,4 +68,15 @@ describe('<Accordion/>', () => {
expect(node.prop('expanded')).toEqual(true);
});
});

it('renders correctly with onItem click on stateless mode', () => {
const wrapper = mount(
<Accordion items={items} />,
);

const item = wrapper.find(AccordionItem).first();
wrapper.setState({ expandedItemIds: [item.prop('id')] });
const expandedItem = wrapper.find(AccordionItem).first();
expect(expandedItem.prop('expanded')).toEqual(true);
});
});

0 comments on commit a3d6280

Please sign in to comment.