Created
March 18, 2022 07:18
-
-
Save matschaffer/01336e0d8c04dbd050d05f14483a3c6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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