2020-01-22 17:47:09 +01:00
|
|
|
import React from 'react';
|
2020-01-28 16:07:01 +01:00
|
|
|
import renderer from 'react-test-renderer';
|
2020-01-22 17:47:09 +01:00
|
|
|
import { shallow } from 'enzyme';
|
2020-01-28 16:07:01 +01:00
|
|
|
import { IntlProvider } from 'react-intl';
|
2020-01-22 17:47:09 +01:00
|
|
|
|
|
|
|
|
import Inputs from '../index';
|
|
|
|
|
|
|
|
|
|
describe('<Inputs />', () => {
|
|
|
|
|
const props = {
|
|
|
|
|
name: 'events',
|
|
|
|
|
value: ['media.create, media.delete'],
|
|
|
|
|
onChange: jest.fn(),
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
it('should render properly', () => {
|
|
|
|
|
const tree = renderer.create(
|
|
|
|
|
<IntlProvider locale="en">
|
|
|
|
|
<Inputs {...props} />
|
|
|
|
|
</IntlProvider>
|
|
|
|
|
);
|
2020-01-29 17:44:51 +01:00
|
|
|
|
2020-01-28 16:07:01 +01:00
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
|
});
|
2020-01-22 17:47:09 +01:00
|
|
|
});
|