diff --git a/tests/domain/runtime-interaction-system.test.ts b/tests/domain/runtime-interaction-system.test.ts index 68267cc1..0ec1f6f6 100644 --- a/tests/domain/runtime-interaction-system.test.ts +++ b/tests/domain/runtime-interaction-system.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from "vitest"; import { createEmptyRuntimeControlSurfaceDefinition } from "../../src/controls/control-surface"; +import { createEmptyProjectDialogueLibrary } from "../../src/dialogues/project-dialogues"; import { createPlayerStartInputBindings, createPlayerStartMovementTemplate @@ -8,6 +9,7 @@ import { import { createPlayAnimationInteractionLink, createPlaySoundInteractionLink, + createStartDialogueInteractionLink, createTeleportPlayerInteractionLink, createToggleVisibilityInteractionLink, createStopAnimationInteractionLink, @@ -19,6 +21,7 @@ import { createEmptyProjectScheduler } from "../../src/scheduler/project-schedul import { RuntimeInteractionSystem } from "../../src/runtime-three/runtime-interaction-system"; import { createRuntimeProjectSchedulerState } from "../../src/runtime-three/runtime-project-scheduler"; import type { RuntimeSceneDefinition } from "../../src/runtime-three/runtime-scene-build"; +import type { RuntimeInteractionDispatcher } from "../../src/runtime-three/runtime-interaction-system"; function createRuntimeSceneFixture(): RuntimeSceneDefinition { const movementTemplate = createPlayerStartMovementTemplate(); @@ -28,6 +31,7 @@ function createRuntimeSceneFixture(): RuntimeSceneDefinition { scheduler: createRuntimeProjectSchedulerState({ document: createEmptyProjectScheduler() }), + dialogues: createEmptyProjectDialogueLibrary(), world: { ...createDefaultWorldSettings(), background: { @@ -171,6 +175,22 @@ function createRuntimeSceneFixture(): RuntimeSceneDefinition { }; } +function createDispatcher( + overrides: Partial = {} +): RuntimeInteractionDispatcher { + return { + teleportPlayer: () => {}, + activateSceneExit: () => {}, + toggleBrushVisibility: () => {}, + playAnimation: () => {}, + stopAnimation: () => {}, + playSound: () => {}, + stopSound: () => {}, + startDialogue: () => {}, + ...overrides + }; +} + describe("RuntimeInteractionSystem", () => { it("dispatches teleport player on Trigger Volume enter", () => { const runtimeScene = createRuntimeSceneFixture();