Fix tests
This commit is contained in:
@@ -48,7 +48,6 @@ public:
|
||||
if (!doc) {
|
||||
return false;
|
||||
}
|
||||
// qWarning() << doc->toPlainText() <<text;
|
||||
return text == doc->toPlainText();
|
||||
}
|
||||
|
||||
@@ -58,7 +57,6 @@ public:
|
||||
if (cursor.isNull()) {
|
||||
return false;
|
||||
}
|
||||
// qWarning() << RichFormat::formatsAtCursor(cursor) <<formats;
|
||||
return RichFormat::formatsAtCursor(cursor) == formats;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ TestCase {
|
||||
spyCursor.clear();
|
||||
}
|
||||
|
||||
function cleanupTestCase(): void {
|
||||
testHelper.textItem = null;
|
||||
textItemHelper.textItem = null;
|
||||
}
|
||||
|
||||
function test_item(): void {
|
||||
compare(textItemHelper.textItem, textEdit);
|
||||
compare(spyItem.count, 0);
|
||||
|
||||
@@ -42,6 +42,9 @@ public:
|
||||
|
||||
Q_INVOKABLE void setFixedChars(const QString &startChars, const QString &endChars)
|
||||
{
|
||||
if (!m_textItem) {
|
||||
return;
|
||||
}
|
||||
m_textItem->setFixedChars(startChars, endChars);
|
||||
}
|
||||
|
||||
@@ -138,10 +141,11 @@ public:
|
||||
if (!m_textItem) {
|
||||
return;
|
||||
}
|
||||
const auto textItem = new ChatTextItemHelper();
|
||||
const auto textItem = new ChatTextItemHelper(this);
|
||||
textItem->setTextItem(item);
|
||||
textItem->setCursorPosition(cursorPos);
|
||||
m_textItem->setCursorFromTextItem(textItem, infront);
|
||||
textItem->deleteLater();
|
||||
}
|
||||
|
||||
Q_INVOKABLE void mergeFormatOnCursor(RichFormat::Format format)
|
||||
|
||||
@@ -181,7 +181,7 @@ void ModelTest::testRoomTreeModel()
|
||||
void ModelTest::testMessageContentModel()
|
||||
{
|
||||
auto contentModel = std::make_unique<MessageContentModel>(room, eventId);
|
||||
auto tester = new QAbstractItemModelTester(contentModel.get());
|
||||
auto tester = new QAbstractItemModelTester(contentModel.get(), contentModel.get());
|
||||
tester->setUseFetchMore(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ QQC2.Control {
|
||||
}
|
||||
|
||||
width: chatScrollView.width
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
spacing: 0
|
||||
|
||||
Repeater {
|
||||
id: chatContentView
|
||||
|
||||
Reference in New Issue
Block a user