UNPKG

@roo-ui/components

Version:

27 lines 879 B
import React from 'react'; import { qantas as theme } from '@roo-ui/themes'; import { mountWithTheme } from '@roo-ui/test-utils'; import CalendarNav from '.'; describe('<CalendarNav />', function () { var wrapper; var props = { prevProps: { onClick: jest.fn() }, nextProps: { onClick: jest.fn() } }; beforeEach(function () { wrapper = mountWithTheme(React.createElement(CalendarNav, props), theme); }); it('renders correctly', function () { expect(wrapper).toMatchSnapshot(); }); it('passes props.prevProps to first <Button />', function () { expect(wrapper.find('Button').first().props()).toEqual(expect.objectContaining(props.prevProps)); }); it('passes props.nextProps to second <Button />', function () { expect(wrapper.find('Button').last().props()).toEqual(expect.objectContaining(props.nextProps)); }); });