2021-04-12 13:32:25 +00:00
|
|
|
import React from "react";
|
|
|
|
import { mount } from "enzyme";
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
import RegistrationForm from "components/forms/RegistrationForm";
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
describe("RegistrationForm - component", () => {
|
|
|
|
it("renders AdminDetails and header on the first page", () => {
|
2016-11-16 16:58:25 +00:00
|
|
|
const form = mount(<RegistrationForm page={1} />);
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
expect(form.find("AdminDetails").length).toEqual(1);
|
|
|
|
expect(form.text()).toContain("Setup user");
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders OrgDetails on the second page", () => {
|
2016-11-16 16:58:25 +00:00
|
|
|
const form = mount(<RegistrationForm page={2} />);
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
expect(form.find("OrgDetails").length).toEqual(1);
|
|
|
|
expect(form.text()).toContain("Organization details");
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders KolideDetails on the third page", () => {
|
2016-11-16 16:58:25 +00:00
|
|
|
const form = mount(<RegistrationForm page={3} />);
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
expect(form.find("KolideDetails").length).toEqual(1);
|
|
|
|
expect(form.text()).toContain("Set Fleet URL");
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders ConfirmationPage on the fourth page", () => {
|
2016-11-16 16:58:25 +00:00
|
|
|
const form = mount(<RegistrationForm page={4} />);
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
expect(form.find("ConfirmationPage").length).toEqual(1);
|
|
|
|
expect(form.text()).toContain("You're all set");
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
});
|