Preserve newer composer edits when a reply finishes sending

This commit is contained in:
evgeny committed 2026-10-08 00:36:52 +02:00
1 parent adf1e9507a
commit ba0b21b999
3 files changed
+18 -3

No files matched your search

+11
View File
@@ -87,6 +87,17 @@ private slots:
editor->setPlainText("next"); QTest::keyClick(editor, Qt::Key_Return); QVERIFY(texts[1][1].toByteArray().isEmpty());
}
void replyResultKeepsTextWrittenWhileSending() {
InputBar bar(nullptr, nullptr); bar.show(); bar.setRecordingContext("/tmp", "123");
auto* editor = bar.findChild<QTextEdit*>(); QVERIFY(editor);
const QByteArray original(32, 'a'); bar.setReply(original, "Alice", "Original");
QSignalSpy sends(&bar, &InputBar::sendMessage);
editor->setPlainText("first"); QTest::keyClick(editor, Qt::Key_Return);
editor->setPlainText("second"); bar.submissionResult(sends[0][2].toULongLong(), true);
QCOMPARE(editor->toPlainText(), QString("second")); QTest::keyClick(editor, Qt::Key_Return);
QCOMPARE(sends.size(), 2); QCOMPARE(sends[1][1].toByteArray(), original);
}
void initTestCase() {
debug_config_init(); debug_set_category_level(DEBUG_CATEGORY_GENERAL, DEBUG_LEVEL_DEBUG);
QApplication::setAttribute(Qt::AA_DontUseNativeDialogs);