Clean up top level window access and add coverage to shared data class

This commit is contained in:
Veronica Berglyd Olsen
2024-02-03 15:34:33 +01:00
parent d5064a8333
commit 4d016c3b75
11 changed files with 36 additions and 48 deletions
+2 -4
View File
@@ -22,8 +22,6 @@ from __future__ import annotations
import pytest
from tools import getGuiItem
from PyQt5.QtWidgets import QAction
from novelwriter import SHARED
@@ -49,8 +47,8 @@ def testToolNovelDetails_Main(qtbot, nwGUI, prjLipsum, ipsumText):
# Create the dialog
nwGUI.mainMenu.aNovelDetails.activate(QAction.ActionEvent.Trigger)
qtbot.waitUntil(lambda: getGuiItem("GuiNovelDetails") is not None, timeout=1000)
details = getGuiItem("GuiNovelDetails")
qtbot.waitUntil(lambda: SHARED.findTopLevelWidget(GuiNovelDetails) is not None, timeout=1000)
details = SHARED.findTopLevelWidget(GuiNovelDetails)
assert isinstance(details, GuiNovelDetails)
# Overview Page