fleet/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.tests.jsx
RachelElysia aeb852e168
Remove username from UI (#1168)
* Remove username from UI code
* Remove username from tests
* Remove username from database
* Modify server endpoints for removing username
* Implement backend aspects of removing username
* Update API docs
* Add name to fleetctl
2021-06-24 13:42:29 -07:00

37 lines
1 KiB
JavaScript

import React from "react";
import { mount } from "enzyme";
import { noop } from "lodash";
import ConfirmationPage from "components/forms/RegistrationForm/ConfirmationPage";
describe("ConfirmationPage - form", () => {
const formData = {
name: "Rachel Perkins",
email: "rachel@fleet.com",
org_name: "Fleet",
fleet_web_address: "http://localhost:8080",
};
it("renders the user information", () => {
const form = mount(
<ConfirmationPage formData={formData} handleSubmit={noop} />
);
expect(form.text()).toContain(formData.name);
expect(form.text()).toContain(formData.email);
expect(form.text()).toContain(formData.org_name);
expect(form.text()).toContain(formData.fleet_web_address);
});
it("submits the form", () => {
const handleSubmitSpy = jest.fn();
const form = mount(
<ConfirmationPage formData={formData} handleSubmit={handleSubmitSpy} />
);
const htmlForm = form.find("form");
htmlForm.simulate("submit");
expect(handleSubmitSpy).toHaveBeenCalled();
});
});