emailField.spec.jsx 798 B

12345678910111213141516171819202122232425262728
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import {EmailField, Form} from 'app/components/forms';
  3. describe('EmailField', function () {
  4. describe('render()', function () {
  5. it('renders', function () {
  6. const wrapper = mountWithTheme(<EmailField name="fieldName" />);
  7. expect(wrapper).toSnapshot();
  8. });
  9. it('renders with value', function () {
  10. const wrapper = mountWithTheme(
  11. <EmailField name="fieldName" value="foo@example.com" />
  12. );
  13. expect(wrapper).toSnapshot();
  14. });
  15. it('renders with form context', function () {
  16. const wrapper = mountWithTheme(
  17. <Form initialData={{fieldName: 'foo@example.com'}}>
  18. <EmailField name="fieldName" />
  19. </Form>
  20. );
  21. expect(wrapper).toSnapshot();
  22. });
  23. });
  24. });