2021-04-12 13:32:25 +00:00
|
|
|
import React from "react";
|
2022-03-28 18:50:20 +00:00
|
|
|
import { render, screen } from "@testing-library/react";
|
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", () => {
|
2025-09-29 17:10:41 +00:00
|
|
|
it("renders AdminDetails on the first page", () => {
|
2022-03-28 18:50:20 +00:00
|
|
|
const { container } = render(<RegistrationForm page={1} />);
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2022-03-28 18:50:20 +00:00
|
|
|
expect(
|
|
|
|
|
container.querySelectorAll(".user-registration__container--admin").length
|
|
|
|
|
).toEqual(1);
|
2025-09-29 17:10:41 +00:00
|
|
|
// headers moved up to parent RegistrationPage.tsx
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders OrgDetails on the second page", () => {
|
2022-03-28 18:50:20 +00:00
|
|
|
const { container } = render(<RegistrationForm page={2} />);
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2022-03-28 18:50:20 +00:00
|
|
|
expect(
|
|
|
|
|
container.querySelectorAll(".user-registration__container--org").length
|
|
|
|
|
).toEqual(1);
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
|
2021-06-11 00:01:18 +00:00
|
|
|
it("renders FleetDetails on the third page", () => {
|
2022-03-28 18:50:20 +00:00
|
|
|
const { container } = render(<RegistrationForm page={3} />);
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2022-03-28 18:50:20 +00:00
|
|
|
expect(
|
|
|
|
|
container.querySelectorAll(".user-registration__container--fleet").length
|
|
|
|
|
).toEqual(1);
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders ConfirmationPage on the fourth page", () => {
|
2022-03-28 18:50:20 +00:00
|
|
|
const { container } = render(<RegistrationForm page={4} />);
|
2016-11-16 16:58:25 +00:00
|
|
|
|
2022-03-28 18:50:20 +00:00
|
|
|
expect(
|
|
|
|
|
container.querySelectorAll(".user-registration__container--confirmation")
|
|
|
|
|
.length
|
|
|
|
|
).toEqual(1);
|
2016-11-16 16:58:25 +00:00
|
|
|
});
|
|
|
|
|
});
|