Add test for NPC dialogue references to missing dialogue resources
This commit is contained in:
@@ -219,6 +219,27 @@ describe("validateSceneDocument", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("rejects NPC dialogue references that point to missing dialogue resources", () => {
|
||||||
|
const npc = createNpcEntity({
|
||||||
|
id: "entity-npc-guide",
|
||||||
|
actorId: "actor-guide",
|
||||||
|
dialogueId: "dialogue-missing"
|
||||||
|
});
|
||||||
|
const document = createEmptySceneDocument();
|
||||||
|
document.entities[npc.id] = npc;
|
||||||
|
|
||||||
|
const validation = validateSceneDocument(document);
|
||||||
|
|
||||||
|
expect(validation.errors).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
expect.objectContaining({
|
||||||
|
code: "missing-dialogue-resource",
|
||||||
|
path: `entities.${npc.id}.dialogueId`
|
||||||
|
})
|
||||||
|
])
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("accepts typed scheduler light control effects in the scene document", () => {
|
it("accepts typed scheduler light control effects in the scene document", () => {
|
||||||
const pointLight = createPointLightEntity({
|
const pointLight = createPointLightEntity({
|
||||||
id: "entity-point-light-main",
|
id: "entity-point-light-main",
|
||||||
|
|||||||
Reference in New Issue
Block a user