summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-31 05:04:05 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-31 05:04:05 (GMT)
commit11bb694587a053b81b289db4d8db586abef42818 (patch)
tree045f28db55d019221d1fceca6dd4956ef455655c
parent83c26ec4ca66eaf8f94aaa56cac20393949fee6c (diff)
Add more autotest (fix signature addseparator support)
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index 0ebea5b..eaaafdd 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -126,7 +126,18 @@ void RichTextComposerNgTest::shouldAddSignature()
KIdentityManagement::Signature newSignature(QStringLiteral("Signature"));
newSignature.setEnabledSignature(true);
richtextComposerNg.insertSignature(newSignature, KIdentityManagement::Signature::Start, KIdentityManagement::Signature::AddSeparator);
- QString expected = QStringLiteral("Signaturefoo bla, bli\nbb");
+ QString expected = QStringLiteral("-- \nSignaturefoo bla, bli\nbb");
+ QCOMPARE(richtextComposerNg.toPlainText(), expected);
+
+
+ richtextComposerNg.setPlainText(QStringLiteral("foo bla, bli\nbb"));
+ richtextComposerNg.insertSignature(newSignature, KIdentityManagement::Signature::Start, KIdentityManagement::Signature::AddNewLines);
+ expected = QStringLiteral("\n\nSignature\nfoo bla, bli\nbb");
+ QCOMPARE(richtextComposerNg.toPlainText(), expected);
+
+ richtextComposerNg.setPlainText(QStringLiteral("foo bla, bli\nbb"));
+ richtextComposerNg.insertSignature(newSignature, KIdentityManagement::Signature::Start, KIdentityManagement::Signature::AddNewLines);
+ expected = QStringLiteral("\n\nSignature\nfoo bla, bli\nbb");
QCOMPARE(richtextComposerNg.toPlainText(), expected);
}