emailField.spec.jsx 794 B

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