grafana/public/app/features/profile/SignupForm.test.tsx
Tobias Skarhed 0c4dae321c
Migrations: Signup page (#21514)
* Start Angular migration

* Add SignupCtrl

* Change name signup

* Add backend call

* Put form in separate file

* Add form model

* Start using react-hook-forms

* Add FormModel to state

* Reduxify

* Connect nav with Redux

* Fix routing and navModel

* Fetch state options on mount

* Add default values and add button margin

* Add errror messages

* Fix title

* Remove files and cleanup

* Add Signup tests

* Add boot config assingnAutoOrg and verifyEmailEnabled

* Remove onmount call

* Remove ctrl and move everything to SignupForm

* Make routeParams optional for testing

* Remove name if it is empty

* Set username

* Make function component

* Fix subpath issues and add link button

* Move redux to SignupPage
2020-02-17 11:13:13 +01:00

19 lines
786 B
TypeScript

import React from 'react';
import { shallow } from 'enzyme';
import { SignupForm } from './SignupForm';
describe('SignupForm', () => {
describe('With different values for verifyEmail and autoAssignOrg', () => {
it('should render input fields', () => {
const wrapper = shallow(<SignupForm verifyEmailEnabled={true} autoAssignOrg={false} />);
expect(wrapper.exists('Forms.Input[name="orgName"]'));
expect(wrapper.exists('Forms.Input[name="code"]'));
});
it('should not render input fields', () => {
const wrapper = shallow(<SignupForm verifyEmailEnabled={false} autoAssignOrg={true} />);
expect(wrapper.exists('Forms.Input[name="orgName"]')).toBeFalsy();
expect(wrapper.exists('Forms.Input[name="code"]')).toBeFalsy();
});
});
});