Skip to content

Commit

Permalink
ちょこっと変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Oct 23, 2024
1 parent 277f017 commit 83bbd73
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/components/Sing/SequencerRuler/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from "@storybook/vue3";
import { ref } from "vue";
import { fn, expect, Mock } from "@storybook/test";

import Presentation from "./Presentation.vue";
Expand All @@ -19,17 +18,8 @@ const meta: Meta<typeof Presentation> = {
tpqn: 480,
offset: 0,
numMeasures: 32,
playheadTicks: 0,
},

render: (args) => ({
components: { Presentation },
setup() {
const playheadTicks = ref(0);

return { args, playheadTicks };
},
template: `<Presentation v-bind="args" v-model:playheadTicks="playheadTicks" />`,
}),
};

export default meta;
Expand All @@ -50,10 +40,6 @@ export const MovePlayhead: Story = {
if (!ruler) {
throw new UnreachableError("ruler is not found");
}
const rectElem = canvasElement.querySelector<SVGRectElement>("rect");
if (!rectElem) {
throw new UnreachableError("rect is not found");
}

// userEvent.pointerは座標指定が上手くいかないので、MouseEventを使って手動でクリックをエミュレートする
const rect = ruler.getBoundingClientRect();
Expand All @@ -65,7 +51,7 @@ export const MovePlayhead: Story = {
clientY: rect.top + rect.height,
});

rectElem.dispatchEvent(event);
ruler.dispatchEvent(event);

await expect(args["onUpdate:playheadTicks"]).toHaveBeenCalled();

Expand Down

0 comments on commit 83bbd73

Please sign in to comment.