QueryField.test.tsx 663 B

12345678910111213141516171819
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import { QueryField } from './QueryField';
  4. describe('<QueryField />', () => {
  5. it('renders with null initial value', () => {
  6. const wrapper = shallow(<QueryField initialQuery={null} />);
  7. expect(wrapper.find('div').exists()).toBeTruthy();
  8. });
  9. it('renders with empty initial value', () => {
  10. const wrapper = shallow(<QueryField initialQuery="" />);
  11. expect(wrapper.find('div').exists()).toBeTruthy();
  12. });
  13. it('renders with initial value', () => {
  14. const wrapper = shallow(<QueryField initialQuery="my query" />);
  15. expect(wrapper.find('div').exists()).toBeTruthy();
  16. });
  17. });