diff --git a/client/cypress/e2e/posting-bills/posting-bills.cy.js b/client/cypress/e2e/posting-bills/posting-bills.cy.js index 327170cf0..14fefb970 100644 --- a/client/cypress/e2e/posting-bills/posting-bills.cy.js +++ b/client/cypress/e2e/posting-bills/posting-bills.cy.js @@ -5,10 +5,10 @@ import Dinero from "dinero.js"; const uuid = () => Cypress._.random(0, 1e6); -describe( +describe.only( "Billing job parts orders", { - defaultCommandTimeout: 5000, + defaultCommandTimeout: 10000, }, () => { const today = moment(new Date()).format("YYYY-MM-DD"); @@ -61,6 +61,13 @@ describe( cy.get("#bill-form-date").click(); cy.get(`[title="${today}"]`).should("be.visible").click({ force: true }); + cy.get('[data-cy="bill-form-parts-bin"]').find("input").click(); + cy.get("#location_list") + .next() + .find(".ant-select-item-option-content") + .first() + .click(); + cy.get('[data-cy="bill-line-table"]').each(($row) => { // get retail amount cy.wrap($row) @@ -77,7 +84,7 @@ describe( cy.get('[data-cy="bill-form-bill-total"]').type(sum); }); - // // Click save + // Click save cy.get('[data-cy="bill-form-save-button"]').click(); cy.get(".ant-notification-notice-message").contains( @@ -102,6 +109,13 @@ describe( cy.get("#bill-form-date").click(); cy.get(`[title="${today}"]`).should("be.visible").click({ force: true }); + cy.get('[data-cy="bill-form-parts-bin"]').find("input").click(); + cy.get("#location_list") + .next() + .find(".ant-select-item-option-content") + .first() + .click(); + cy.get('[data-cy="bill-line-table"]').each(($row) => { // get retail amount cy.wrap($row) @@ -146,6 +160,13 @@ describe( cy.get("#bill-form-date").click(); cy.get(`[title="${today}"]`).should("be.visible").click({ force: true }); + cy.get('[data-cy="bill-form-parts-bin"]').find("input").click(); + cy.get("#location_list") + .next() + .find(".ant-select-item-option-content") + .first() + .click(); + cy.get('[data-cy="bill-line-table"]').each(($row) => { // get retail amount cy.wrap($row) @@ -248,7 +269,7 @@ describe( } ); -describe.only( +describe( "Validating and calculating bills", { defaultCommandTimeout: 10000, @@ -310,6 +331,13 @@ describe.only( cy.get("#bill-form-date").click(); cy.get(`[title="${today}"]`).should("be.visible").click({ force: true }); + cy.get('[data-cy="bill-form-parts-bin"]').find("input").click(); + cy.get("#location_list") + .next() + .find(".ant-select-item-option-content") + .first() + .click(); + cy.get('[data-cy="bill-line-table"]').each(($row) => { // get retail amount cy.wrap($row) @@ -501,7 +529,7 @@ describe.only( } ); - // cy.get('[data-cy="bill-form-save-button"]').click(); + cy.get('[data-cy="bill-form-save-button"]').click(); cy.get("#totalReturns") .invoke("text") @@ -637,7 +665,7 @@ describe.only( // TODO add more assertions to the parts table // location, status - it.only("views the row expander if it has the order and bill", () => { + it("views the row expander if it has the order and bill", () => { cy.get('[data-cy="tab-repairdata"]').should("be.visible").click(); cy.get('[data-cy="filter-parts-button"]') @@ -652,6 +680,34 @@ describe.only( .first() .click(); + // TODO find location from bodyshop config + // cy.get('[data-cy="repair-data-table"]') + // .find(".ant-table-tbody") + // .find("> tr:not(.ant-table-measure-row)") + // .first() + // .find("td") + // .eq(13) + // .find("div") + // .should("exist"); + + cy.get('[data-cy="repair-data-table"]') + .find(".ant-table-tbody") + .find("> tr:not(.ant-table-measure-row)") + .first() + .find("td") + .eq(14) + .find("div") + .should("exist"); + + cy.get('[data-cy="repair-data-table"]') + .find(".ant-table-tbody") + .find("> tr:not(.ant-table-measure-row)") + .first() + .find("td") + .eq(15) + .find("div") + .should("have.text", "Returned"); + cy.get('[data-cy="parts-bills-order"]') .should("be.visible") .find("li") diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx index 5593ed25e..4c7f309ed 100644 --- a/client/src/components/bill-form/bill-form.component.jsx +++ b/client/src/components/bill-form/bill-form.component.jsx @@ -321,7 +321,12 @@ export function BillFormComponent({ {!billEdit && ( - {bodyshop.md_parts_locations.map((loc, idx) => ( {loc}