Skip to content

Commit

Permalink
Modification to e2e/sampleTablePage.cy test failing due to duplicate …
Browse files Browse the repository at this point in the history
…submit button
  • Loading branch information
BenjaminCharmes committed Mar 18, 2024
1 parent 570b626 commit a7f6695
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/cypress/e2e/sampleTablePage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/CreateSampleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:modelValue="modelValue"
@update:modelValue="$emit('update:modelValue', $event)"
:disableSubmit="Boolean(sampleIDValidationMessage) || !Boolean(item_id)"
submitID="sample-submit"
>
<template v-slot:header> Add new sample </template>

Expand Down
11 changes: 10 additions & 1 deletion webapp/src/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
</div>
<div class="modal-footer">
<slot name="footer">
<input type="submit" class="btn btn-info" :disabled="disableSubmit" value="Submit" />
<input
:id="submitID"
type="submit"
class="btn btn-info"
:disabled="disableSubmit"
value="Submit"
/>
<button
type="button"
class="btn btn-secondary"
Expand Down Expand Up @@ -57,6 +63,9 @@ export default {
type: Boolean,
default: false,
},
submitID: {
type: String,
},
},
watch: {
modelValue(newValue) {
Expand Down

0 comments on commit a7f6695

Please sign in to comment.