Skip to content

Commit

Permalink
Fix interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Aug 8, 2024
1 parent 1d7feab commit d4e7156
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
30 changes: 22 additions & 8 deletions src/client/cypress/e2e/editor/boreholeTable.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");

Expand Down
15 changes: 11 additions & 4 deletions src/client/src/api-lib/ReduxStateInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface ReduxRootState {
core_user: User;
core_borehole_editor_list: Boreholes;
core_borehole: Boreholes;
core_borehole: Borehole;
}

export interface User {
Expand Down Expand Up @@ -35,7 +35,7 @@ interface Workflow {
workflow: number;
}

interface BoreholeAttribute {
interface BoreholeAttributes {
workgroup: Workgroup;
workflow: Workflow;
id: number;
Expand Down Expand Up @@ -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;
}

0 comments on commit d4e7156

Please sign in to comment.