Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Created March 18, 2022 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matschaffer/01336e0d8c04dbd050d05f14483a3c6c to your computer and use it in GitHub Desktop.
Save matschaffer/01336e0d8c04dbd050d05f14483a3c6c to your computer and use it in GitHub Desktop.
import React from 'react';
import {componentWithIntl} from '../../helpers/intl-helpers';
import RotationStyles from '../../../src/components/direction-picker/direction-picker';
import DirectionPicker from '../../../src/components/direction-picker/direction-picker';
import PropTypes from 'prop-types';
import {intlShape} from 'react-intl';
describe('DirectionPicker', () => {
const getComponent = function (props = {}) {
return <DirectionPicker {...props} />;
};
test('matches snapshot', () => {
const props = {
// direction: PropTypes.number,
disabled: false,
// intl: intlShape,
// labelAbove: PropTypes.bool,
onChangeDirection: jest.fn(),
onClickAllAround: jest.fn(),
onClickDontRotate: jest.fn(),
onClickLeftRight: jest.fn(),
onClosePopover: jest.fn(),
onOpenPopover: jest.fn(),
popoverOpen: false
// rotationStyle: PropTypes.string
};
const component = componentWithIntl(getComponent(props));
const picker = component.root.findByType(DirectionPicker);
console.log(picker);
expect(component.toJSON()).toMatchSnapshot();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment