From 50809a0392322dbd33e4c5d84e025f77f9464fef Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 09:26:56 +0200 Subject: [PATCH] Modify RuntimeInteractionSystem test to include full dialogue structure and update startDialogue to startNpcDialogue --- .../domain/runtime-interaction-system.test.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/domain/runtime-interaction-system.test.ts b/tests/domain/runtime-interaction-system.test.ts index 1769e625..8e67bf03 100644 --- a/tests/domain/runtime-interaction-system.test.ts +++ b/tests/domain/runtime-interaction-system.test.ts @@ -191,6 +191,7 @@ function createDispatcher( stopAnimation: () => {}, playSound: () => {}, stopSound: () => {}, + startNpcDialogue: () => {}, startDialogue: () => {}, ...overrides }; @@ -918,7 +919,20 @@ describe("RuntimeInteractionSystem", () => { }, yawDegrees: 180, modelAssetId: null, - dialogueId: "dialogue-merchant", + dialogues: [ + { + id: "dialogue-merchant", + title: "Merchant Greeting", + lines: [ + { + id: "dialogue-merchant-line-1", + speakerName: "Merchant", + text: "Fresh goods." + } + ] + } + ], + defaultDialogueId: "dialogue-merchant", collider: { mode: "capsule", radius: 0.3, @@ -964,16 +978,16 @@ describe("RuntimeInteractionSystem", () => { "entity-npc-merchant", runtimeScene, createDispatcher({ - startDialogue: (dialogueId, source) => { + startNpcDialogue: (npcEntityId, dialogueId, source) => { dispatches.push( - `${source?.kind}:${source?.sourceEntityId}:${source?.trigger}:${dialogueId}` + `${source?.kind}:${source?.sourceEntityId}:${source?.trigger}:${npcEntityId}:${dialogueId}` ); } }) ); expect(dispatches).toEqual([ - "npc:entity-npc-merchant:click:dialogue-merchant" + "npc:entity-npc-merchant:click:entity-npc-merchant:dialogue-merchant" ]); });