UNPKG

@momentum-ui/react

Version:

Cisco Momentum UI framework for ReactJs applications

40 lines (29 loc) 1.03 kB
import React from 'react'; import { shallow } from 'enzyme'; import { TabPane } from '@momentum-ui/react'; describe('tests for <TabPane />', () => { it('should match SnapShot', () => { const container = shallow(<TabPane />); expect(container).toMatchSnapshot(); }); it('should render one TabPane', () => { const container = shallow(<TabPane />); expect(container.find('.md-tab__pane').length).toEqual(1); }); it('should render inactive by default', () => { const container = shallow(<TabPane />); expect(container.find('.md-tab__pane').hasClass('active')).toEqual(false); }); it('should render active when passed', () => { const container = shallow(<TabPane active />); expect(container.find('.md-tab__pane').hasClass('active')).toEqual(true); }); it('should render children', () => { const container = shallow( <TabPane> <div className="testingforTP" /> </TabPane> ); expect(container.find('.testingforTP').length).toEqual(1); }); });