Add test for NPC foundation entity migration with default collider settings

This commit is contained in:
2026-04-13 17:37:37 +02:00
parent 5cb37780ec
commit 94dfc1be1e

View File

@@ -1658,6 +1658,51 @@ describe("scene document JSON", () => {
expect(Object.keys(migratedDocument.materials)).toEqual(STARTER_MATERIAL_LIBRARY.map((material) => material.id));
});
it("migrates NPC foundation entities to include default collider settings", () => {
const migratedDocument = migrateSceneDocument({
version: NPC_ENTITY_FOUNDATION_SCENE_DOCUMENT_VERSION,
name: "NPC Collider Migration",
world: createEmptySceneDocument().world,
materials: createEmptySceneDocument().materials,
textures: {},
assets: {},
brushes: {},
modelInstances: {},
entities: {
"entity-npc-guide": {
id: "entity-npc-guide",
kind: "npc",
position: {
x: 1,
y: 0,
z: 2
},
visible: true,
enabled: true,
actorId: "actor-town-guide",
yawDegrees: 30,
modelAssetId: null
}
},
interactionLinks: {}
});
expect(migratedDocument.version).toBe(SCENE_DOCUMENT_VERSION);
expect(migratedDocument.entities["entity-npc-guide"]).toEqual(
createNpcEntity({
id: "entity-npc-guide",
actorId: "actor-town-guide",
position: {
x: 1,
y: 0,
z: 2
},
yawDegrees: 30,
modelAssetId: null
})
);
});
it("migrates slice 3.0 documents to the current schema version without changing empty asset collections", () => {
const migratedDocument = migrateSceneDocument({
version: MODEL_ASSET_PIPELINE_SCENE_DOCUMENT_VERSION,