diff --git a/client/cypress/e2e/intake/intake-checklist.cy.js b/client/cypress/e2e/intake/intake-checklist.cy.js index 426d44d29..2f598f98e 100644 --- a/client/cypress/e2e/intake/intake-checklist.cy.js +++ b/client/cypress/e2e/intake/intake-checklist.cy.js @@ -1,3 +1,5 @@ +import job from "../../fixtures/jobs/job-3.json"; + describe( "Adding job to checklist", { @@ -5,20 +7,44 @@ describe( }, () => { beforeEach(() => { - cy.visit("/manage"); + cy.visit("/manage/jobs"); - cy.get("body").then(($body) => { - if ($body.text().includes("Login")) { - // Log in - cy.get('[data-cy="username"]').type("john@imex.dev"); - cy.get('[data-cy="password"]').type("john123"); - cy.get('[data-cy="sign-in-button"]').click(); + cy.intercept("POST", Cypress.env("graphql_dev_endpoint"), (req) => { + if (req.body.operationName === "QUERY_BODYSHOP") { + req.alias = "bodyshop"; } + }); - cy.get(".ant-table-tbody") - .should("be.visible") - .find("tr") - .should("not.have.class", "ant-table-placeholder"); + cy.get('[data-cy="active-jobs-table"]') + .find(".ant-table-tbody") + .find("> tr:not(.ant-table-measure-row)") + .as("active-jobs-table") + .should("not.have.class", "ant-table-placeholder"); + + cy.get("@active-jobs-table") + .contains(job.clm_no) + .first() + .parent() + .find('[data-cy="active-job-link"]') + .click(); + }); + + it.only("tests the form", () => { + cy.get('[data-cy="job-actions-button"]').click(); + // Go to intake + cy.get('[data-cy="job-intake-button"]').should("not.be.disabled").click(); + cy.url().should("include", "/intake"); + // Fill out the form + cy.get('[data-cy="checklist-form"]').should("be.visible"); + + cy.wait("@bodyshop").then(({ response }) => { + const bodyshop = response.body.data.bodyshops[0]; + + // intakechecklist + const checklists = bodyshop.intakechecklist.form; + + //console.log(checklists); + cy.get(".ant-slider-dot:eq(1)").click({ force: true }); }); }); diff --git a/client/cypress/e2e/job-import/job-import.cy.js b/client/cypress/e2e/job-import/job-import.cy.js index 155183026..a15756f62 100644 --- a/client/cypress/e2e/job-import/job-import.cy.js +++ b/client/cypress/e2e/job-import/job-import.cy.js @@ -491,7 +491,9 @@ describe( cy.get("#towin").should("have.class", "ant-switch").click(); cy.get('[data-cy="convert-button"]').click(); - cy.get(".ant-notification-notice-message").contains("successfully"); + cy.get(".ant-notification-notice-message").contains( + "Job converted successfully." + ); }); }); } diff --git a/client/src/components/config-form-components/slider/slider.component.jsx b/client/src/components/config-form-components/slider/slider.component.jsx index ba5a665e5..5f11e564c 100644 --- a/client/src/components/config-form-components/slider/slider.component.jsx +++ b/client/src/components/config-form-components/slider/slider.component.jsx @@ -4,6 +4,18 @@ import React from "react"; export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) { const { name, label, required, min, max } = formItem; + const marks = { + [min]: { + label:  , + }, + [max / 2]: { + label:  , + }, + [max]: { + label:  , + }, + }; + return ( - + ); }