Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プルリクエスト from hiho-counter-pr-83bbd735 #3

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading