Added assertions on query request body; deleted todo-delete; added list of more tests to add

This commit is contained in:
2022-11-17 09:10:01 -06:00
parent 5f08b9dae2
commit cf51e47a3d

View File

@ -43,7 +43,13 @@ describe("table query screen", () =>
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
cy.contains("Filters").click(); cy.contains("Filters").click();
cy.get(".MuiDataGrid-filterForm input.MuiInput-input").should("be.focused").type("1"); cy.get(".MuiDataGrid-filterForm input.MuiInput-input").should("be.focused").type("1");
cy.wait(["@personQuery", "@personCount"]);
///////////////////////////////////////////////////////////////////
// assert that query & count both have the expected filter value //
///////////////////////////////////////////////////////////////////
let expectedFilterContents = JSON.stringify({fieldName: "id", operator: "EQUALS", values: ["1"]});
cy.wait("@personQuery").its("request.body").should((body) => expect(body).to.contain(expectedFilterContents));
cy.wait("@personCount").its("request.body").should((body) => expect(body).to.contain(expectedFilterContents));
/////////////////////////////////////// ///////////////////////////////////////
// click away from the filter window // // click away from the filter window //
@ -57,49 +63,21 @@ describe("table query screen", () =>
cy.waitForStableDOM(); cy.waitForStableDOM();
cy.get("#clearFiltersButton").should("be.visible").click(); cy.get("#clearFiltersButton").should("be.visible").click();
cy.contains("button", "Yes").click(); cy.contains("button", "Yes").click();
cy.wait(["@personQuery", "@personCount"]);
////////////////////////////////////////////////////////////////////
// assert that query & count both no longer have the filter value //
////////////////////////////////////////////////////////////////////
cy.wait("@personQuery").its("request.body").should((body) => expect(body).not.to.contain(expectedFilterContents));
cy.wait("@personCount").its("request.body").should((body) => expect(body).not.to.contain(expectedFilterContents));
cy.contains(".MuiDataGrid-toolbarContainer .MuiBadge-root", "1").should("not.exist"); cy.contains(".MuiDataGrid-toolbarContainer .MuiBadge-root", "1").should("not.exist");
}); });
// tests to add:
xit("todo delete", () => // - filter boolean OR
{ // - sort column
// cy.get(".MuiDataGrid-columnHeaders input[type='checkbox']").click(); // - all field types and operators
// cy.contains("button", "Bulk Actions").click(); // - pagination, page size
// cy.contains("li", "Bulk Edit").click(); // - check marks, select all
// - column chooser
// ////////////////////////////
// // bulk edit process init //
// ////////////////////////////
// cy.location().should((loc) =>
// {
// expect(loc.pathname).to.eq("/processes/person.bulkEdit");
// expect(loc.search).to.eq("?recordsParam=recordIds&recordIds=1,2,3,4,5");
// });
// cy.wait(["@personBulkEditMetaData"]);
// cy.wait(["@personBulkEditInit"]);
// cy.contains("p[variation='h5']", "Edit Values");
// cy.get("#bulkEditSwitch-firstName").click();
// cy.get("input[name='firstName']").click()
// .type("Kahhhhn");
// cy.contains("button", "next").click();
// ///////////////////////////
// // bulk edit review step //
// ///////////////////////////
// cy.contains("p[variation='h5']", "Review");
// cy.contains(".MuiDataGrid-cellContent", "Kahhhhn");
// cy.contains("button", "submit").click();
// cy.wait(["@personBulkEditStepEdit"]);
// cy.wait(["@personBulkEditRecords"]);
// ////////////////////////////
// // bulk edit result step //
// ////////////////////////////
// cy.contains("p[variation='h5']", "Results");
// cy.wait(["@personBulkEditRecords"]);
});
}); });