From 83bbd73533b2eb3477861a965b13660ab1cf9499 Mon Sep 17 00:00:00 2001 From: Hiroshiba Kazuyuki Date: Wed, 23 Oct 2024 20:37:01 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=A1=E3=82=87=E3=81=93=E3=81=A3=E3=81=A8?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sing/SequencerRuler/index.stories.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/components/Sing/SequencerRuler/index.stories.ts b/src/components/Sing/SequencerRuler/index.stories.ts index 8ef6fdd65b..f0882b463e 100644 --- a/src/components/Sing/SequencerRuler/index.stories.ts +++ b/src/components/Sing/SequencerRuler/index.stories.ts @@ -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"; @@ -19,17 +18,8 @@ const meta: Meta = { tpqn: 480, offset: 0, numMeasures: 32, + playheadTicks: 0, }, - - render: (args) => ({ - components: { Presentation }, - setup() { - const playheadTicks = ref(0); - - return { args, playheadTicks }; - }, - template: ``, - }), }; export default meta; @@ -50,10 +40,6 @@ export const MovePlayhead: Story = { if (!ruler) { throw new UnreachableError("ruler is not found"); } - const rectElem = canvasElement.querySelector("rect"); - if (!rectElem) { - throw new UnreachableError("rect is not found"); - } // userEvent.pointerは座標指定が上手くいかないので、MouseEventを使って手動でクリックをエミュレートする const rect = ruler.getBoundingClientRect(); @@ -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();