2020-01-22 17:47:09 +01:00
|
|
|
import React from 'react';
|
2020-02-03 15:31:08 +01:00
|
|
|
// import renderer from 'react-test-renderer';
|
2020-01-22 17:47:09 +01:00
|
|
|
import { shallow } from 'enzyme';
|
2020-02-03 15:31:08 +01:00
|
|
|
// import { IntlProvider } from 'react-intl';
|
2020-01-22 17:47:09 +01:00
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// import translationMessages from '../../../translations/en.json';
|
2020-01-29 19:27:26 +01:00
|
|
|
|
2020-01-22 17:47:09 +01:00
|
|
|
import Inputs from '../index';
|
|
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// const renderWithIntl = (Compo, props) => {
|
|
|
|
|
// return renderer.create(
|
|
|
|
|
// <IntlProvider locale="en" messages={translationMessages}>
|
|
|
|
|
// <Compo {...props} />
|
|
|
|
|
// </IntlProvider>
|
|
|
|
|
// );
|
|
|
|
|
// };
|
|
|
|
|
|
2020-01-22 17:47:09 +01:00
|
|
|
describe('<Inputs />', () => {
|
|
|
|
|
const props = {
|
|
|
|
|
name: 'events',
|
|
|
|
|
value: ['media.create, media.delete'],
|
|
|
|
|
onChange: jest.fn(),
|
2020-01-29 19:27:26 +01:00
|
|
|
type: 'events',
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-28 16:07:01 +01:00
|
|
|
it('should not crash', () => {
|
2020-01-22 17:47:09 +01:00
|
|
|
shallow(<Inputs {...props} />);
|
|
|
|
|
});
|
2020-01-28 16:07:01 +01:00
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// FIXME: snapshots
|
|
|
|
|
// it('should match the snapshot if type is events', () => {
|
|
|
|
|
// const tree = renderWithIntl(Inputs, props);
|
2020-01-29 19:27:26 +01:00
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// expect(tree).toMatchSnapshot();
|
|
|
|
|
// });
|
2020-01-29 19:27:26 +01:00
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// it('should match the snapshot if type is headers', () => {
|
|
|
|
|
// const tree = renderWithIntl(Inputs, { ...props, type: 'headers' });
|
2020-01-29 17:44:51 +01:00
|
|
|
|
2020-02-03 15:31:08 +01:00
|
|
|
// expect(tree).toMatchSnapshot();
|
|
|
|
|
// });
|
2020-01-22 17:47:09 +01:00
|
|
|
});
|