Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing field in setup confirmation #2005

Merged
merged 4 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/integration/all/setup/setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ describe("Setup", () => {
cy.contains("button:enabled", /next/i).click();

// Page 3
cy.contains("button:enabled", /submit/i).click();
cy.contains("button:enabled", /next/i).click();

// Page 4
cy.contains("button:enabled", /finish/i).click();
cy.contains("button:enabled", /confirm/i).click();

cy.url().should("match", /\/hosts\/manage$/i);
cy.contains(/all hosts/i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("ConfirmationPage - form", () => {
name: "Rachel Perkins",
email: "rachel@fleet.com",
org_name: "Fleet",
fleet_web_address: "http://localhost:8080",
server_url: "http://localhost:8080",
};

it("renders the user information", () => {
Expand All @@ -20,7 +20,7 @@ describe("ConfirmationPage - form", () => {
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);
expect(form.text()).toContain(formData.server_url);
});

it("submits the form", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ConfirmationPage = ({
currentPage,
formData,
handleSubmit,
}: IConfirmationPageProps) => {
}: IConfirmationPageProps): JSX.Element => {
useEffect(() => {
if (currentPage) {
// Component has a transition duration of 300ms set in
Expand Down Expand Up @@ -57,12 +57,7 @@ const ConfirmationPage = ({
);
};

const {
email,
fleet_web_address: fleetWebAddress,
org_name: orgName,
name,
} = formData;
const { email, server_url: serverUrl, org_name: orgName, name } = formData;
const tabIndex = currentPage ? 1 : -1;

const confirmRegClasses = classnames(className, baseClass);
Expand All @@ -88,11 +83,8 @@ const ConfirmationPage = ({
<tr>
<th>Fleet URL:</th>
<td>
<span
className={`${baseClass}__table-url`}
title={fleetWebAddress}
>
{fleetWebAddress}
<span className={`${baseClass}__table-url`} title={serverUrl}>
{serverUrl}
</span>
</td>
</tr>
Expand All @@ -112,7 +104,7 @@ const ConfirmationPage = ({
disabled={!currentPage}
className="button button--brand"
>
Finish
Confirm
</Button>
</form>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FleetDetails extends Component {
disabled={!currentPage}
className="button button--brand"
>
Submit
Next
</Button>
</form>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class RegistrationForm extends Component {
<ConfirmationPage
formData={formData}
handleSubmit={onSubmitConfirmation}
classNmae={confirmationClass}
className={confirmationClass}
currentPage={isCurrentPage(4)}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/interfaces/registration_form_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface IRegistrationFormData {
org_web_url: string;
org_logo_url: string;
fleet_web_address: string;
server_url: string;
}