Add test coverage

This commit is contained in:
Veronica Berglyd Olsen
2025-09-13 15:27:38 +02:00
parent 42f0d71ecf
commit 410d8bfe13
2 changed files with 28 additions and 10 deletions
+15 -1
View File
@@ -27,7 +27,8 @@ import pytest
from PyQt6.QtCore import QEvent, QMimeData, QPointF, Qt, QThreadPool, QUrl
from PyQt6.QtGui import (
QAction, QClipboard, QDesktopServices, QDragEnterEvent, QDragMoveEvent,
QDropEvent, QFont, QMouseEvent, QTextBlock, QTextCursor, QTextOption
QDropEvent, QFont, QInputMethodEvent, QMouseEvent, QTextBlock, QTextCursor,
QTextOption
)
from PyQt6.QtWidgets import QApplication, QMenu, QPlainTextEdit
@@ -1941,6 +1942,19 @@ def testGuiEditor_Completer(qtbot, nwGUI, projPath, mockRnd):
"%Note.Consistency: \n"
)
# CJK completer reposition (#2267)
qtbot.keyClick(docEditor, "%", delay=KEY_DELAY)
assert completer.isVisible() is True
completer.move(0, 0)
assert completer.pos().x() == 0
assert completer.pos().y() == 0
event = QInputMethodEvent()
event.setCommitString("Ping")
docEditor.inputMethodEvent(event)
assert completer.pos().x() > 0 # Should have moved
assert completer.pos().y() > 0 # Should have moved
# qtbot.stop()