diff --git a/packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx b/packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx index 974215bf8a..ca748162c7 100644 --- a/packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx +++ b/packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx @@ -1,6 +1,6 @@ // @vitest-environment happy-dom import { act } from "react"; -import { describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { createRoot } from "react-dom/client"; import { AudioFxGroup } from "./propertyPanelAudioFxGroup.js"; import type { DomEditSelection } from "./domEditingTypes"; @@ -12,14 +12,37 @@ const CHAIN = JSON.stringify({ nodes: [{ type: "lowpass", id: "n1", params: { frequency: 900, q: 1.2, poles: "2" } }], }); -function mount(dataAttributes: Record) { +// Each mount appends its tracks to the document; without clearing, a later +// "only one audio track" case would still find the previous test's sibling. +afterEach(() => { + document.body.innerHTML = ""; +}); + +/** + * A selected `