Skip to content

Commit

Permalink
Fix the "Not Found" view and implement an e2e test
Browse files Browse the repository at this point in the history
ref #250
  • Loading branch information
frostburn committed May 19, 2023
1 parent c75afb2 commit 34f3773
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
30 changes: 30 additions & 0 deletions cypress/integration/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// https://docs.cypress.io/api/introduction/api.html

describe("Basic test", () => {
it("visits the app root url", () => {
cy.visit("/");
cy.contains("h2", "Scale data");
});
});

describe("404 page", () => {
it("creates an octaplex", () => {
cy.visit("/non-existing-page");
cy.contains("h2", "Not found");
cy.get("a")
.last()
.click()
.then(() => {
cy.get("button")
.first()
.click()
.then(() => {
cy.contains("h2", "Scale data");
cy.get("#scale-name").should(
"have.value",
"The Octaplex (3 5 7 11)"
);
});
});
});
});
8 changes: 0 additions & 8 deletions cypress/integration/example.spec.ts

This file was deleted.

17 changes: 10 additions & 7 deletions src/views/NotFoundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
import OctaplexPortal from "@/components/modals/generation/SummonOctaplex.vue";
import type { Synth } from "@/synth";
import { encodeQuery } from "@/url-encode";
import type { Scale } from "scale-workshop-core";
import { nextTick, ref } from "vue";
Expand All @@ -28,7 +27,11 @@ const props = defineProps<{
equaveShift: number;
degreeShift: number;
synth: Synth;
waveform: string;
attackTime: number;
decayTime: number;
sustainLevel: number;
releaseTime: number;
}>();
const emit = defineEmits(["update:scale", "update:scaleName"]);
Expand Down Expand Up @@ -56,11 +59,11 @@ function openTheGates(scale: Scale) {
equaveShift: props.equaveShift,
degreeShift: props.degreeShift,
waveform: props.synth.waveform,
attackTime: props.synth.attackTime,
decayTime: props.synth.decayTime,
sustainLevel: props.synth.sustainLevel,
releaseTime: props.synth.releaseTime,
waveform: props.waveform,
attackTime: props.attackTime,
decayTime: props.decayTime,
sustainLevel: props.sustainLevel,
releaseTime: props.releaseTime,
};
const query = encodeQuery(state) as LocationQuery;
Expand Down

0 comments on commit 34f3773

Please sign in to comment.