diff --git a/tests/unit/runtime-host.test.ts b/tests/unit/runtime-host.test.ts index 7e8dcb35..99ce5490 100644 --- a/tests/unit/runtime-host.test.ts +++ b/tests/unit/runtime-host.test.ts @@ -439,75 +439,6 @@ describe("RuntimeHost", () => { host.dispose(); }); - it("does not consume a trigger-started one-line dialogue on the immediate next click", () => { - vi.spyOn(console, "warn").mockImplementation(() => undefined); - vi.spyOn(RapierCollisionWorld, "create").mockResolvedValue({ - dispose: vi.fn(), - resolveThirdPersonCameraCollision: vi.fn( - (_pivot, desiredCameraPosition) => desiredCameraPosition - ) - } as unknown as RapierCollisionWorld); - - const document = createEmptySceneDocument(); - document.dialogues.dialogues["dialogue-trigger"] = { - id: "dialogue-trigger", - title: "Trigger", - lines: [ - { - id: "dialogue-line-trigger-1", - speakerName: null, - text: "Triggered." - } - ] - }; - - const host = new RuntimeHost({ - enableRendering: false - }); - host.loadScene(buildRuntimeSceneFromDocument(document)); - - const hostInternals = host as unknown as { - createInteractionDispatcher(): { - startDialogue( - dialogueId: string, - source?: { - kind: "interactionLink" | "npc" | "direct"; - sourceEntityId: string | null; - linkId: string | null; - trigger: "enter" | "exit" | "click" | null; - } - ): void; - }; - sceneReady: boolean; - runtimeScene: unknown; - activeController: unknown; - thirdPersonController: unknown; - handleRuntimeClick(): void; - currentDialogue: RuntimeDialogueState | null; - }; - hostInternals.sceneReady = true; - hostInternals.activeController = hostInternals.thirdPersonController; - - const dispatcher = hostInternals.createInteractionDispatcher(); - dispatcher.startDialogue("dialogue-trigger", { - kind: "interactionLink", - sourceEntityId: "entity-trigger-main", - linkId: "link-trigger-dialogue", - trigger: "enter" - }); - - hostInternals.handleRuntimeClick(); - expect(hostInternals.currentDialogue).toEqual( - expect.objectContaining({ - dialogueId: "dialogue-trigger" - }) - ); - - hostInternals.handleRuntimeClick(); - expect(hostInternals.currentDialogue).toBeNull(); - - host.dispose(); - }); it("applies expanded typed control effects for model, sound, and scene lighting", () => { vi.spyOn(console, "warn").mockImplementation(() => undefined);