Skip to content

Commit

Permalink
Fix base frequency encoding in URL
Browse files Browse the repository at this point in the history
Access a reactive property to trigger the watcher.
Implement Cypress test to verify the fix.

ref #508
  • Loading branch information
frostburn committed Nov 30, 2023
1 parent 8e0d20c commit ac690bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cypress/integration/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ describe("Basic test", () => {
cy.visit("/");
cy.contains("h2", "Scale data");
});

it("preserves the base frequency when changing tabs", () => {
cy.visit("/");
cy.get(".real-valued")
.clear()
.type("432")
.trigger("change")
.should("have.value", "432");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(400); // Wait for debounce to expire.
cy.get("a").contains("Synth").click();
cy.url().should("contain", "f=");
});
});

describe("404 page", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ watch(
() => [
scaleName.value,
scaleLines.value,
scale,
scale.baseFrequency,
baseMidiNote.value,
keyColors.value,
isomorphicHorizontal.value,
Expand Down

0 comments on commit ac690bf

Please sign in to comment.