diff --git a/src/client/cypress/e2e/editor/boreholeTable.cy.js b/src/client/cypress/e2e/editor/boreholeTable.cy.js index 08bd9b4c2..4b3267a23 100644 --- a/src/client/cypress/e2e/editor/boreholeTable.cy.js +++ b/src/client/cypress/e2e/editor/boreholeTable.cy.js @@ -1,5 +1,12 @@ -import { loginAsAdmin } from "../helpers/testHelpers.js"; -import { showTableAndWaitForData, sortBy, verifyRowContains } from "../helpers/dataGridHelpers"; +import { loginAsAdmin, returnToOverview } from "../helpers/testHelpers.js"; +import { + clickOnRowWithText, + showTableAndWaitForData, + sortBy, + verifyPaginationText, + verifyRowContains, + waitForTableData, +} from "../helpers/dataGridHelpers"; describe("Borehole editor table tests", () => { it("Boreholes are displayed in correct order with admin login", () => { @@ -58,7 +65,7 @@ describe("Borehole editor table tests", () => { waitForTableData(); // verify current page is 4 - verifiyPaginationText("401 - 500 of 1626"); + verifyPaginationText("401–500 of 1626"); verifyRowContains("Nichole VonRueden", 0); // navigate to detail @@ -69,7 +76,7 @@ describe("Borehole editor table tests", () => { // verify current page is still 4 showTableAndWaitForData(); - verifiyPaginationText("401 - 500 of 1626"); + verifyPaginationText("401–500 of 1626"); verifyRowContains("Nichole VonRueden", 0); }); }); diff --git a/src/client/cypress/e2e/filters/filter.cy.js b/src/client/cypress/e2e/filters/filter.cy.js index b417b56bf..a4cfd9121 100644 --- a/src/client/cypress/e2e/filters/filter.cy.js +++ b/src/client/cypress/e2e/filters/filter.cy.js @@ -1,5 +1,5 @@ import { loginAsAdmin } from "../helpers/testHelpers.js"; -import { showTableAndWaitForData, verifiyPaginationText } from "../helpers/dataGridHelpers"; +import { showTableAndWaitForData, verifyPaginationText } from "../helpers/dataGridHelpers"; describe("Search filter tests", () => { it("has search filters", () => { @@ -91,7 +91,7 @@ describe("Search filter tests", () => { // check content of table showTableAndWaitForData(); - verifiyPaginationText("1 - 100 of 329"); // when testing with cypress locally use electron browser, otherwise text might be displayed as "1-100 of 329" + verifyPaginationText("1–100 of 329"); }); it("filters boreholes by color and uscs3", () => { @@ -117,7 +117,7 @@ describe("Search filter tests", () => { cy.wait("@edit_list"); showTableAndWaitForData(); - verifiyPaginationText("1 - 100 of 229"); + verifyPaginationText("1–100 of 229"); let uscs3Dropdown = cy.contains("label", "USCS 3").next(); uscs3Dropdown.scrollIntoView().click({ force: true }); @@ -135,7 +135,7 @@ describe("Search filter tests", () => { cy.wait("@edit_list"); // check content of table - verifiyPaginationText("1 - 39 of 39"); + verifyPaginationText("1–39 of 39"); cy.get(".MuiDataGrid-row").contains("Darion Rowe").should("exist"); }); @@ -152,7 +152,7 @@ describe("Search filter tests", () => { filterByOriginalLithology(); cy.wait("@edit_list"); showTableAndWaitForData(); - verifiyPaginationText("1 - 21 of 21"); + verifyPaginationText("1–21 of 21"); }); it("filters boreholes by creation date", () => { loginAsAdmin(); @@ -180,7 +180,7 @@ describe("Search filter tests", () => { // check content of table showTableAndWaitForData(); - verifiyPaginationText("1 - 3 of 3"); + verifyPaginationText("1–3 of 3"); }); it("filters boreholes by workgroup", () => { diff --git a/src/client/cypress/e2e/filters/identifierFilter.cy.js b/src/client/cypress/e2e/filters/identifierFilter.cy.js index 8fc2a2863..85e363186 100644 --- a/src/client/cypress/e2e/filters/identifierFilter.cy.js +++ b/src/client/cypress/e2e/filters/identifierFilter.cy.js @@ -1,5 +1,5 @@ import { newEditableBorehole, returnToOverview, stopBoreholeEditing } from "../helpers/testHelpers.js"; -import { checkAllVisibleRows, verifiyPaginationText } from "../helpers/dataGridHelpers"; +import { checkAllVisibleRows, verifyPaginationText } from "../helpers/dataGridHelpers"; describe("Tests for filtering data by identifier.", () => { it("can filter by identifier", () => { @@ -21,7 +21,7 @@ describe("Tests for filtering data by identifier.", () => { // show all options cy.get('[class="ui fitted toggle checkbox"]').eq(0).children().first().check({ force: true }); - verifiyPaginationText("1 - 100 of 1627"); // when testing with cypress locally use electron browser, otherwise text might be displayed as "1-100 of 1627" + verifyPaginationText("1–100 of 1627"); cy.get('[data-cy="domain-dropdown"]') .first() @@ -30,10 +30,10 @@ describe("Tests for filtering data by identifier.", () => { .eq(1) .click({ force: true }); - verifiyPaginationText("1 - 1 of 1"); + verifyPaginationText("1–1 of 1"); // click reset label cy.get('[data-cy="reset-filter-button"]').click(); - verifiyPaginationText("1 - 100 of 1627"); + verifyPaginationText("1–100 of 1627"); }); it("can bulk edit boreholes while filter by identifier is set", () => { @@ -74,7 +74,7 @@ describe("Tests for filtering data by identifier.", () => { .find('[role="option"]') .eq(1) .click({ force: true }); - verifiyPaginationText("1 - 2 of 2"); + verifyPaginationText("1–2 of 2"); checkAllVisibleRows(); cy.contains("button", "Bulk editing").click({ force: true }); diff --git a/src/client/cypress/e2e/filters/srsFilter.cy.js b/src/client/cypress/e2e/filters/srsFilter.cy.js index 3e6e6a84f..927a501cf 100644 --- a/src/client/cypress/e2e/filters/srsFilter.cy.js +++ b/src/client/cypress/e2e/filters/srsFilter.cy.js @@ -1,5 +1,5 @@ import { loginAsAdmin, newEditableBorehole, returnToOverview, stopBoreholeEditing } from "../helpers/testHelpers.js"; -import { verifiyPaginationText } from "../helpers/dataGridHelpers"; +import { verifyPaginationText } from "../helpers/dataGridHelpers"; describe("Tests for filtering data by reference system.", () => { function goToEditorLocationFilter() { @@ -51,18 +51,18 @@ describe("Tests for filtering data by reference system.", () => { cy.contains("h6", "Location").click(); cy.get('[class="ui fitted toggle checkbox"]').eq(0).children().first().check({ force: true }); cy.get('[data-cy="radiobutton-all"]').click(); - verifiyPaginationText("1 - 100 of 1627"); // when testing with cypress locally use electron browser, otherwise text might be displayed as "1-100 of 1627" + verifyPaginationText("1–100 of 1627"); cy.get('[data-cy="spatial-reference-filter"]').should("exist"); cy.get('[data-cy="radiobutton-LV95"]').click(); - verifiyPaginationText("1 - 100 of 813"); + verifyPaginationText("1–100 of 813"); cy.get('[data-cy="radiobutton-LV03"]').click(); - verifiyPaginationText("1 - 100 of 814"); + verifyPaginationText("1–100 of 814"); // click reset label cy.get('[data-cy="reset-filter-button"]').click(); - verifiyPaginationText("1 - 100 of 1627"); + verifyPaginationText("1–100 of 1627"); }); }); diff --git a/src/client/cypress/e2e/helpers/dataGridHelpers.js b/src/client/cypress/e2e/helpers/dataGridHelpers.js index 2cb4dd03e..14654134d 100644 --- a/src/client/cypress/e2e/helpers/dataGridHelpers.js +++ b/src/client/cypress/e2e/helpers/dataGridHelpers.js @@ -1,4 +1,4 @@ -export const verifiyPaginationText = text => { +export const verifyPaginationText = text => { cy.get(".MuiTablePagination-displayedRows").should("have.text", text); };