Skip to content

Commit

Permalink
Fix import cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Dec 17, 2024
1 parent 323b5a2 commit 55747d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/client/cypress/e2e/mainPage/import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,6 @@ describe("Test for importing boreholes.", () => {
});
});

// Select borehole attachments
let attachmentFileList = new DataTransfer();
getImportFileFromFixtures("borehole_attachment_1.pdf", "utf-8").then(fileContent => {
const file = new File([fileContent], "borehole_attachment_1.pdf", {
type: "application/pdf",
});
attachmentFileList.items.add(file);
});
getImportFileFromFixtures("borehole_attachment_2.zip", "utf-8").then(fileContent => {
const file = new File([fileContent], "borehole_attachment_2.zip", {
type: "application/zip",
});
attachmentFileList.items.add(file);
});
cy.get('[data-cy="import-boreholeFile-attachments-input"]').within(() => {
cy.get("input[type=file]", { force: true }).then(input => {
input[0].files = attachmentFileList.files;
input[0].dispatchEvent(new Event("change", { bubbles: true }));
});
});

// Import boreholes and attachments
cy.get('[data-cy="import-button"]').click();
cy.wait("@borehole-upload");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name;original_name;location_x;location_y;attachments;
BH-1001;Wellington 1;2156784;1154321;borehole_attachment_1.pdf,borehole_attachment_2.zip;
name;original_name;location_x;location_y;
BH-1001;Wellington 1;2156784;1154321;
BH-1002;Wellington 2;2367999;1276543;
BH-1003;Wellington 3;2189456;1334567;
BH-1004;Wellington 4;2312345;1200987;

0 comments on commit 55747d2

Please sign in to comment.