import React from 'react';
import { shallow } from 'enzyme';
const Item = text =>
Item {text}
;
const Composition = ({ showB }) => (
{showB && }
);
describe('', () => {
it('should render one item if showB is set to false', () => {
const wrapper = shallow();
expect(wrapper.find(Item)).toHaveLength(1);
});
it('should render two items if showB is set to true', () => {
const wrapper = shallow();
expect(wrapper.find(Item)).toHaveLength(2);
});
});