Update test coverage
This commit is contained in:
@@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from time import time
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
@@ -58,6 +60,7 @@ def testGuiDocSearch_Main(qtbot, monkeypatch, nwGUI, prjLipsum):
|
|||||||
assert result == (handle, 3, 5)
|
assert result == (handle, 3, 5)
|
||||||
|
|
||||||
# Move down
|
# Move down
|
||||||
|
search.searchText.setFocus()
|
||||||
qtbot.keyClick(search, Qt.Key.Key_Down)
|
qtbot.keyClick(search, Qt.Key.Key_Down)
|
||||||
assert firstDoc.isSelected() is True
|
assert firstDoc.isSelected() is True
|
||||||
|
|
||||||
@@ -119,6 +122,11 @@ def testGuiDocSearch_Main(qtbot, monkeypatch, nwGUI, prjLipsum):
|
|||||||
assert search.searchResult.topLevelItemCount() == 10
|
assert search.searchResult.topLevelItemCount() == 10
|
||||||
assert totalCount() == 34
|
assert totalCount() == 34
|
||||||
|
|
||||||
|
# Re-run search should not change the result
|
||||||
|
search.textChanged(handle, time() + 1000.0)
|
||||||
|
assert search.searchResult.topLevelItemCount() == 10
|
||||||
|
assert totalCount() == 34
|
||||||
|
|
||||||
# qtbot.stop()
|
# qtbot.stop()
|
||||||
nwGUI.closeProject()
|
nwGUI.closeProject()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user