diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 02318a1e..b7b20578 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -242,7 +242,7 @@ class GuiMain(QMainWindow): tHandle = self.treeView.getSelectedHandle() if tHandle is None: logger.warning("No document selected") - return + return False tItem = self.theProject.getItem(tHandle) if tItem.itemType == nwItemType.FILE: @@ -263,7 +263,7 @@ class GuiMain(QMainWindow): self.splitMain.setSizes(bPos) self.docEditor.changeWidth() - return + return True ## # Tree Item Actions diff --git a/tests/test_gui.py b/tests/test_gui.py index 4f098b6c..681c2116 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -105,6 +105,10 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): assert nwGUI.saveDocument() qtbot.wait(stepDelay) + # Open and view the edited document + assert nwGUI.openDocument("31489056e0916") + assert nwGUI.viewDocument("31489056e0916") + # Check the files projFile = path.join(nwTempGUI,"nwProject.nwx") assert cmpFiles(projFile, path.join(nwRef,"gui","1_nwProject.nwx"), [2])