Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Dec 19, 2024
1 parent be3fafd commit c4c332b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/client/cypress/e2e/detailPage/boreholeform.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { clickOnRowWithText, showTableAndWaitForData, sortBy } from "../helpers/
import { evaluateInput, evaluateSelect, isDisabled, setInput, setSelect } from "../helpers/formHelpers";
import {
createBorehole,
getElementByDataCy,
goToRouteAndAcceptTerms,
handlePrompt,
newEditableBorehole,
Expand Down Expand Up @@ -102,14 +103,18 @@ describe("Test for the borehole form.", () => {
setInput("remarks", "This is a test remark");

// navigate away is blocked before saving
cy.get('[data-cy="location-menu-item"]').click();
getElementByDataCy("location-menu-item").click();

const messageUnsavedChanges = "There are unsaved changes. Do you want to discard all changes?";
handlePrompt(messageUnsavedChanges, "cancel");

saveWithSaveBar();
cy.get('[data-cy="location-menu-item"]').click();
getElementByDataCy("location-menu-item").click();
cy.contains("Boreholes.swissgeol.ch ID");

getElementByDataCy("borehole-menu-item");
evaluateSelect("lithostratigraphyTopBedrockId", "Bodensee-Nagelfluh");
evaluateSelect("chronostratigraphyTopBedrockId", "Phanerozoic");
});
});

Expand Down

0 comments on commit c4c332b

Please sign in to comment.