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