| 345 | // ── Batch remove deletes multiple nodes ── |
| 346 | |
| 347 | void testBatchRemove() { |
| 348 | int healthIdx = findNode("health"); |
| 349 | int armorIdx = findNode("armor"); |
| 350 | QVERIFY(healthIdx >= 0); |
| 351 | QVERIFY(armorIdx >= 0); |
| 352 | int before = countNodes(); |
| 353 | |
| 354 | m_ctrl->batchRemoveNodes({healthIdx, armorIdx}); |
| 355 | QApplication::processEvents(); |
| 356 | QCOMPARE(countNodes(), before - 2); |
| 357 | QCOMPARE(findNode("health"), -1); |
| 358 | QCOMPARE(findNode("armor"), -1); |
| 359 | |
| 360 | // Undo restores both |
| 361 | m_doc->undoStack.undo(); |
| 362 | QApplication::processEvents(); |
| 363 | QCOMPARE(countNodes(), before); |
| 364 | QVERIFY(findNode("health") >= 0); |
| 365 | QVERIFY(findNode("armor") >= 0); |
| 366 | } |
| 367 | |
| 368 | // ── Insert with invalid parent still works (root-level) ── |
| 369 |
nothing calls this directly
no test coverage detected