@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
46 lines (33 loc) • 1.29 kB
JavaScript
import React from 'react';
import { shallow, mount } from 'enzyme';
import { ListItemSection } from '@momentum-ui/react-collaboration';
describe('tests for <ListItemSection />', () => {
it('should match SnapShot', () => {
const container = mount(<ListItemSection />);
expect(container).toMatchSnapshot();
});
it('should render one ListItemSection', () => {
const container = shallow(<ListItemSection />);
expect(container.find('.md-list-item__center').length).toEqual(1);
});
it('should handle position prop (left)', () => {
const container = shallow(<ListItemSection position="left" />);
expect(container.find('.md-list-item__left').length).toEqual(1);
});
it('should handle position prop (right)', () => {
const container = shallow(<ListItemSection position="right" />);
expect(container.find('.md-list-item__right').length).toEqual(1);
});
it('should handle className prop', () => {
const container = shallow(<ListItemSection className="right" />);
expect(container.find('.right').length).toEqual(1);
});
it('should render children', () => {
const container = shallow(
<ListItemSection>
<div>Test</div>
</ListItemSection>
);
expect(container.children().length).toEqual(1);
});
});