IO-2327 updated test cases for intake checklist
This commit is contained in:
@@ -3,7 +3,7 @@ import job from "../../fixtures/jobs/job-3.json";
|
|||||||
describe(
|
describe(
|
||||||
"Adding job to checklist",
|
"Adding job to checklist",
|
||||||
{
|
{
|
||||||
defaultCommandTimeout: 5000,
|
defaultCommandTimeout: 10000,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -43,8 +43,36 @@ describe(
|
|||||||
// intakechecklist
|
// intakechecklist
|
||||||
const checklists = bodyshop.intakechecklist.form;
|
const checklists = bodyshop.intakechecklist.form;
|
||||||
|
|
||||||
//console.log(checklists);
|
checklists.forEach((item, index) => {
|
||||||
cy.get(".ant-slider-dot:eq(1)").click({ force: true });
|
if (item.type === "text") {
|
||||||
|
cy.get('[data-cy="config-form-components"] > div')
|
||||||
|
.eq(index)
|
||||||
|
.find("input:text")
|
||||||
|
.type("Random Word");
|
||||||
|
} else if (item.type === "textarea") {
|
||||||
|
cy.get('[data-cy="config-form-components"] > div')
|
||||||
|
.eq(index)
|
||||||
|
.find("textarea")
|
||||||
|
.type("Random Word");
|
||||||
|
} else if (item.type === "checkbox") {
|
||||||
|
cy.get('[data-cy="config-form-components"] > div')
|
||||||
|
.eq(index)
|
||||||
|
.find("input:checkbox")
|
||||||
|
.check();
|
||||||
|
} else if (item.type === "slider") {
|
||||||
|
cy.get('[data-cy="config-form-components"] > div')
|
||||||
|
.eq(index)
|
||||||
|
.find(".ant-slider-dot:eq(1)")
|
||||||
|
.click({ force: true });
|
||||||
|
} else if (item.type === "rate") {
|
||||||
|
cy.get('[data-cy="config-form-components"] > div')
|
||||||
|
.eq(index)
|
||||||
|
.find(".ant-rate > li")
|
||||||
|
.eq(Math.floor(Math.random() * 4))
|
||||||
|
.find("div[role='radio']")
|
||||||
|
.click({ force: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import FormTypes from "./config-form-types";
|
|||||||
|
|
||||||
export default function ConfirmFormComponents({ componentList, readOnly }) {
|
export default function ConfirmFormComponents({ componentList, readOnly }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div data-cy="config-form-components">
|
||||||
{componentList.map((f, idx) => {
|
{componentList.map((f, idx) => {
|
||||||
const Comp = FormTypes[f.type];
|
const Comp = FormTypes[f.type];
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
|||||||
min={min || 0}
|
min={min || 0}
|
||||||
max={max || 10}
|
max={max || 10}
|
||||||
marks={marks}
|
marks={marks}
|
||||||
|
style={{ marginBottom: 0, marginTop: 0 }}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user