diff --git a/cypress/e2e/basic.cy.ts b/cypress/e2e/basic.cy.ts index c7016060..98e369c1 100644 --- a/cypress/e2e/basic.cy.ts +++ b/cypress/e2e/basic.cy.ts @@ -49,7 +49,7 @@ describe("Scale generation/modification", () => { for (let i = 0; i < 5; ++i) { cy.get("button").contains("Apply").click(); } - cy.get("button").contains("Close").click(); + cy.get("button").contains("Done").click(); cy.get("#scale-data").should("contain.value", "8/7"); }); }); \ No newline at end of file diff --git a/src/components/ModifyScale.vue b/src/components/ModifyScale.vue index 1d76350e..feaba26d 100644 --- a/src/components/ModifyScale.vue +++ b/src/components/ModifyScale.vue @@ -141,7 +141,7 @@ function clickSubset() { } function clickApproximateByRatios() { - approx.initialize() + approx.initialize(scale.sourceText) showApproximateByRatiosModal.value = true } diff --git a/src/components/modals/modification/ApproximateByRatios.vue b/src/components/modals/modification/ApproximateByRatios.vue index 5f9cec86..901f31cc 100644 --- a/src/components/modals/modification/ApproximateByRatios.vue +++ b/src/components/modals/modification/ApproximateByRatios.vue @@ -121,10 +121,15 @@ function modify(expand = true) { scale.computeScale() emit('done') } + +function cancel() { + scale.sourceText = approx.originalSource + emit('done') +}