From a7f6695db69e78e5aec9b535916bf1d695fbaea0 Mon Sep 17 00:00:00 2001 From: Benjamin CHARMES Date: Mon, 18 Mar 2024 10:22:55 +0000 Subject: [PATCH] Modification to e2e/sampleTablePage.cy test failing due to duplicate submit button --- webapp/cypress/e2e/sampleTablePage.cy.js | 2 +- webapp/src/components/CreateSampleModal.vue | 1 + webapp/src/components/Modal.vue | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/webapp/cypress/e2e/sampleTablePage.cy.js b/webapp/cypress/e2e/sampleTablePage.cy.js index d62822bc5..7e0e05e25 100644 --- a/webapp/cypress/e2e/sampleTablePage.cy.js +++ b/webapp/cypress/e2e/sampleTablePage.cy.js @@ -47,7 +47,7 @@ describe("Sample table page", () => { cy.findByLabelText("Date Created:").type("1990-01-07T00:00"); cy.get("#sample-name").type("This is a sample name"); - cy.contains("Submit").click(); + cy.get("#sample-submit").click(); // check that the sample table is correctly populated cy.findByText("12345678910"); diff --git a/webapp/src/components/CreateSampleModal.vue b/webapp/src/components/CreateSampleModal.vue index 48a29cd68..5d3472e2d 100644 --- a/webapp/src/components/CreateSampleModal.vue +++ b/webapp/src/components/CreateSampleModal.vue @@ -4,6 +4,7 @@ :modelValue="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :disableSubmit="Boolean(sampleIDValidationMessage) || !Boolean(item_id)" + submitID="sample-submit" > diff --git a/webapp/src/components/Modal.vue b/webapp/src/components/Modal.vue index 7a58e2394..d9bffede7 100644 --- a/webapp/src/components/Modal.vue +++ b/webapp/src/components/Modal.vue @@ -23,7 +23,13 @@