@momentum-ui/react
Version:
Cisco Momentum UI framework for ReactJs applications
27 lines (22 loc) • 723 B
JavaScript
import React from 'react';
import { shallow, mount } from 'enzyme';
import {
Tab,
TabList,
} from '@momentum-ui/react';
describe('tests for <TabList />', () => {
it('should match SnapShot', () => {
const context = { focus: 0, onFocus: () => {}, onActivate: () => {} };
const container = shallow(<TabList id="test"><Tab heading="one"/></TabList>, { context });
expect(container).toMatchSnapshot();
});
it('should render children', () => {
const context = { focus: 0, onFocus: () => {}, onActivate: () => {} };
const container = mount(
<TabList>
<Tab heading="one"/>
</TabList>, { context }
);
expect(container.find('.md-tab__item').length).toEqual(1);
});
});