Repository URL to install this package:
|
Version:
8.1.0-rc.5 ▾
|
import React from 'react';
import { shallow } from 'enzyme';
import CustomSelect from './CustomSelect';
describe('CustomSelect', () => {
let component;
let props;
beforeEach(() => {
props = {
options: [
{
text: 'Description',
value: 'descr',
},
],
name: 'test name',
errorMessage: 'Not selected',
valid: true,
label: 'Select country',
};
component = shallow(<CustomSelect {...props} />);
});
it('should match a snapshot', () => {
expect(component.getElement()).toMatchSnapshot();
});
it('should match a snapshot when its not valid', () => {
component.setProps({ valid: false });
expect(component.getElement()).toMatchSnapshot();
});
it('should match a snapshot when there is a note', () => {
component.setProps({ note: 'Some note' });
expect(component.getElement()).toMatchSnapshot();
});
});