Fix bug from project tree test

This commit is contained in:
Veronica Berglyd Olsen
2023-11-17 21:33:22 +01:00
parent 16a56d6f60
commit 1279b0e5b7
2 changed files with 9 additions and 2 deletions
-1
View File
@@ -1455,7 +1455,6 @@ class GuiProjectTree(QTreeWidget):
wCount = self._getItemWordCount(sHandle)
self.propagateCount(sHandle, 0)
event.accept()
super().dropEvent(event)
self._postItemMove(sHandle, wCount)
self._recordLastMove(sItem, pItem, pIndex)
+9 -1
View File
@@ -988,9 +988,17 @@ def testGuiProjTree_DragAndDrop(qtbot, monkeypatch, caplog, nwGUI: GuiMain, proj
mouse = Qt.MouseButton.LeftButton
modifier = Qt.KeyboardModifier.NoModifier
# Move an item
# The actual move is blocked, but the undo history should record
# the event, although without an actual move implied
assert projTree._lastMove == {}
event = QDropEvent(nPos, action, mime, mouse, modifier)
projTree.dropEvent(event)
assert event.isAccepted() is True
assert projTree._lastMove == {
"item": projTree._getTreeItem(C.hSceneDoc),
"parent": projTree._getTreeItem(C.hChapterDir),
"index": 1,
}
# Invalid location
caplog.clear()