Add test coverage
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user