Cleanup chatkeyhelp and tests
This commit is contained in:
@@ -31,12 +31,6 @@ TestCase {
|
||||
textItem: textItemHelper
|
||||
}
|
||||
|
||||
SignalSpy {
|
||||
id: spyItem
|
||||
target: textItemHelper
|
||||
signalName: "textItemChanged"
|
||||
}
|
||||
|
||||
SignalSpy {
|
||||
id: spyUp
|
||||
target: testHelper.keyHelper
|
||||
@@ -63,7 +57,6 @@ TestCase {
|
||||
|
||||
function init(): void {
|
||||
textEdit.clear();
|
||||
spyItem.clear();
|
||||
spyUp.clear();
|
||||
spyDown.clear();
|
||||
spyDelete.clear();
|
||||
@@ -71,6 +64,11 @@ TestCase {
|
||||
textEdit.forceActiveFocus();
|
||||
}
|
||||
|
||||
function cleanupTestCase(): void {
|
||||
testHelper.textItem = null;
|
||||
textItemHelper.textItem = null;
|
||||
}
|
||||
|
||||
function test_upDown(): void {
|
||||
textEdit.insert(0, "line 1\nline 2\nline 3")
|
||||
textEdit.cursorPosition = 0;
|
||||
|
||||
@@ -30,14 +30,13 @@ public:
|
||||
|
||||
ChatTextItemHelper *textItem() const
|
||||
{
|
||||
return m_textItem;
|
||||
return m_keyHelper->textItem;
|
||||
}
|
||||
void setTextItem(ChatTextItemHelper *textItem)
|
||||
{
|
||||
if (textItem == m_textItem) {
|
||||
if (textItem == m_keyHelper->textItem) {
|
||||
return;
|
||||
}
|
||||
m_textItem = textItem;
|
||||
m_keyHelper->textItem = textItem;
|
||||
Q_EMIT textItemChanged();
|
||||
}
|
||||
@@ -51,6 +50,5 @@ Q_SIGNALS:
|
||||
void textItemChanged();
|
||||
|
||||
private:
|
||||
QPointer<ChatTextItemHelper> m_textItem;
|
||||
QPointer<ChatKeyHelper> m_keyHelper;
|
||||
};
|
||||
|
||||
@@ -253,7 +253,6 @@ TestCase {
|
||||
compare(testHelper.checkFormatsAtCursor([]), true);
|
||||
testHelper.mergeFormatOnCursor(RichFormat.Strikethrough);
|
||||
compare(testHelper.checkFormatsAtCursor([RichFormat.Strikethrough]), true);
|
||||
compare(testHelper.markdownText(), "***lots*** _of_ ~~text~~");
|
||||
textEdit.clear();
|
||||
|
||||
textEdit.insert(0, "heading");
|
||||
|
||||
Reference in New Issue
Block a user