summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-30 20:42:18 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-30 20:42:18 (GMT)
commit83c26ec4ca66eaf8f94aaa56cac20393949fee6c (patch)
tree5366f597fa57f78e33f0a31140c595ecb708fd04
parente53831add95fc22dd6897a8eb79bba5f63389b4b (diff)
Add more autotests for signature
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp14
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index f4f2784..0ebea5b 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -110,14 +110,24 @@ void RichTextComposerNgTest::shouldForceAutoCorrectionWithSelection()
QCOMPARE(richtextComposerNg.toPlainText(), expected);
}
-void RichTextComposerNgTest::shouldAddSignature()
+void RichTextComposerNgTest::shouldNotChangeSignatureWhenOriginalAndNewSignatureAreSame()
{
MessageComposer::RichTextComposerNg richtextComposerNg;
KIdentityManagement::Signature oldSignature;
const bool replaceSignature = richtextComposerNg.composerSignature()->replaceSignature(oldSignature, oldSignature);
QVERIFY(!replaceSignature);
- //TODO
+}
+
+void RichTextComposerNgTest::shouldAddSignature()
+{
+ MessageComposer::RichTextComposerNg richtextComposerNg;
+ richtextComposerNg.setPlainText(QStringLiteral("foo bla, bli\nbb"));
+ KIdentityManagement::Signature newSignature(QStringLiteral("Signature"));
+ newSignature.setEnabledSignature(true);
+ richtextComposerNg.insertSignature(newSignature, KIdentityManagement::Signature::Start, KIdentityManagement::Signature::AddSeparator);
+ QString expected = QStringLiteral("Signaturefoo bla, bli\nbb");
+ QCOMPARE(richtextComposerNg.toPlainText(), expected);
}
QTEST_MAIN(RichTextComposerNgTest)
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
index deefeb6..3ebfd30 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
@@ -38,6 +38,7 @@ private Q_SLOTS:
void shouldForceAutoCorrectionWithSelection();
+ void shouldNotChangeSignatureWhenOriginalAndNewSignatureAreSame();
void shouldAddSignature();
};