Sha256: 616b93efa4ae8db70cc0733444adf3c76102d5015cc3c832e14634058c030a8b
Contents?: true
Size: 787 Bytes
Versions: 43
Compression:
Stored size: 787 Bytes
Contents
import React from 'react'; import { mount } from 'enzyme'; import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils'; import NavContainer from '../NavContainer'; import { props } from '../NavContainer.fixtures'; const fixtures = { 'render without Props': {}, 'render with Props': props, }; describe('NavContainer', () => { describe('rendering', () => testComponentSnapshotsWithFixtures(NavContainer, fixtures)); it('click should call onTabClick prop', () => { const onTabClick = jest.fn(); const modifiedProps = { ...props, }; modifiedProps.items[0].onClick = onTabClick; const wrapper = mount(<NavContainer {...modifiedProps} />); wrapper.find('NavItem a').simulate('click'); expect(onTabClick).toBeCalled(); }); });
Version data entries
43 entries across 43 versions & 2 rubygems