passwordField.spec.jsx 839 B

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