mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
* 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
19 lines
786 B
TypeScript
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();
|
|
});
|
|
});
|
|
});
|