From fcffd651f4bbc29dfc59d7b3111d0bb01bb41fdc Mon Sep 17 00:00:00 2001 From: ayuan9957 <107920784+ayuan9957@users.noreply.github.com> Date: Tue, 23 Jun 2026 22:06:30 +0800 Subject: [PATCH] test(editor): cover reparent selection undo state --- tests/MetaCoreSmokeTests.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/MetaCoreSmokeTests.cpp b/tests/MetaCoreSmokeTests.cpp index 1c50a7f..e757543 100644 --- a/tests/MetaCoreSmokeTests.cpp +++ b/tests/MetaCoreSmokeTests.cpp @@ -406,12 +406,15 @@ void MetaCoreTestHierarchyEditingCommandsDirtyAndUndo() { editorContext.SelectOnly(*createdId); MetaCoreExpect(sceneEditingService->ReparentSelection(editorContext, *parentId), "ReparentSelection command should reparent selected object"); MetaCoreExpect(scene.FindGameObject(*createdId).GetParentId() == *parentId, "ReparentSelection should set parent id"); + MetaCoreExpect(editorContext.GetActiveObjectId() == *createdId, "ReparentSelection should keep moved object selected"); MetaCoreExpect(scenePersistenceService->IsSceneDirty(), "ReparentSelection command should mark scene dirty"); MetaCoreExpect(editorContext.UndoCommand(), "Undo ReparentSelection should succeed"); MetaCoreExpect(scene.FindGameObject(*createdId).GetParentId() == 0, "Undo ReparentSelection should restore root parent"); + MetaCoreExpect(editorContext.GetActiveObjectId() == *createdId, "Undo ReparentSelection should restore moved object selection"); MetaCoreExpect(!scenePersistenceService->IsSceneDirty(), "Undo ReparentSelection should restore clean baseline"); MetaCoreExpect(editorContext.RedoCommand(), "Redo ReparentSelection should succeed"); MetaCoreExpect(scene.FindGameObject(*createdId).GetParentId() == *parentId, "Redo ReparentSelection should restore parent id"); + MetaCoreExpect(editorContext.GetActiveObjectId() == *createdId, "Redo ReparentSelection should restore moved object selection"); MetaCoreExpect(scenePersistenceService->SaveCurrentScene(editorContext), "Hierarchy command scene should save after reparent"); editorContext.SelectOnly(*createdId);