diff --git a/src/client/cypress/e2e/editor/boreholeTable.cy.js b/src/client/cypress/e2e/editor/boreholeTable.cy.js index eaea03e62..e4edfbed9 100644 --- a/src/client/cypress/e2e/editor/boreholeTable.cy.js +++ b/src/client/cypress/e2e/editor/boreholeTable.cy.js @@ -8,15 +8,29 @@ describe("Borehole editor table tests", () => { cy.wait("@edit_list"); cy.get("div[id=map]").should("be.visible"); - cy.get("tbody").children().should("have.length", 100); - // sort by Name descending - cy.contains("th", "Name").click(); - cy.wait("@edit_list"); + cy.get(".MuiDataGrid-root").should("be.visible"); + cy.get(".loading-indicator").should("not.exist"); + cy.get(".MuiDataGrid-row").should("have.length", 100); - cy.get("tbody").children().eq(0).contains("td", "Aaliyah Casper"); - cy.get("tbody").children().eq(1).contains("td", "Aaliyah Lynch"); - cy.get("tbody").children().eq(2).contains("td", "Aaron Bartell"); + // sort by Name descending + cy.get(".MuiDataGrid-columnHeader").contains("Name").click(); + + cy.get(".MuiDataGrid-row") + .eq(0) // index is 0-based, so eq(1) is the second row + .within(() => { + cy.contains("Aaliyah Casper").should("exist"); + }); + cy.get(".MuiDataGrid-row") + .eq(1) // index is 0-based, so eq(1) is the second row + .within(() => { + cy.contains("Aaliyah Lynch").should("exist"); + }); + cy.get(".MuiDataGrid-row") + .eq(2) // index is 0-based, so eq(1) is the second row + .within(() => { + cy.contains("Aaron Bartell").should("exist"); + }); // sort by borehole type cy.contains("th", "Borehole type").click(); @@ -28,7 +42,7 @@ describe("Borehole editor table tests", () => { // sort by borehole status cy.contains("th", "Drilling purpose").click(); cy.wait("@edit_list"); - cy.get("tbody").children().eq(0).contains("td", "open, no completion"); + cy.get(".MuiDataGrid-virtualScrollerRenderZone").children().eq(0).contains("td", "open, no completion"); cy.get("tbody").children().eq(1).contains("td", "open, no completion"); cy.get("tbody").children().eq(2).contains("td", "open, no completion"); diff --git a/src/client/src/api-lib/ReduxStateInterfaces.ts b/src/client/src/api-lib/ReduxStateInterfaces.ts index f7fe1d11f..1c7c7d0ee 100644 --- a/src/client/src/api-lib/ReduxStateInterfaces.ts +++ b/src/client/src/api-lib/ReduxStateInterfaces.ts @@ -1,7 +1,7 @@ export interface ReduxRootState { core_user: User; core_borehole_editor_list: Boreholes; - core_borehole: Boreholes; + core_borehole: Borehole; } export interface User { @@ -35,7 +35,7 @@ interface Workflow { workflow: number; } -interface BoreholeAttribute { +interface BoreholeAttributes { workgroup: Workgroup; workflow: Workflow; id: number; @@ -65,10 +65,17 @@ interface BoreholeAttribute { } export interface Boreholes { - // Incomplete type definition, add other properties as needed isFetching: boolean; length: number; orderby: string; direction: string; - data: BoreholeAttribute[]; + data: BoreholeAttributes[]; +} + +export interface Borehole { + isFetching: boolean; + length: number; + orderby: string; + direction: string; + data: BoreholeAttributes; }