summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-01 05:54:19 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-01 05:54:19 (GMT)
commitec9ac81b6dc1232f03d2af78c9358c881060f740 (patch)
tree3a9c90cc572ea923cb2ccbac43fcd25c60ee9dec
parent74e2278ac6225498f51bc6b5fdb256bdef6c0af6 (diff)
Add more autotests
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp13
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index 31e20a9..fff55a1 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -209,17 +209,26 @@ void RichTextComposerNgTest::shouldAddSpecificSignature()
QCOMPARE(richtextComposerNg.toPlainText(), expected);
}
+void RichTextComposerNgTest::shouldReplaceSignature_data()
+{
+ QTest::addColumn<QString>("signatureText");
+ QTest::newRow("simple") << QStringLiteral("Signature");
+ QTest::newRow("withnewline") << QStringLiteral("Signature\nnew line");
+}
+
void RichTextComposerNgTest::shouldReplaceSignature()
{
+ QFETCH(QString, signatureText);
MessageComposer::RichTextComposerNg richtextComposerNg;
richtextComposerNg.createActions(new KActionCollection(this));
const QString original(QStringLiteral("foo bla, bli\nbb"));
richtextComposerNg.setPlainText(original);
- KIdentityManagement::Signature newSignature(QStringLiteral("Signature"));
+ KIdentityManagement::Signature newSignature(signatureText);
newSignature.setEnabledSignature(true);
newSignature.setInlinedHtml(false);
- QString expected(QStringLiteral("foo bla, bli\nbb-- \nSignature"));
+
+ QString expected = QStringLiteral("foo bla, bli\nbb-- \n") + signatureText;
richtextComposerNg.insertSignature(newSignature, KIdentityManagement::Signature::End, KIdentityManagement::Signature::AddSeparator);
QCOMPARE(richtextComposerNg.toPlainText(), expected);
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
index 0a47951..2415830 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
@@ -47,6 +47,7 @@ private Q_SLOTS:
void shouldAddSpecificSignature();
+ void shouldReplaceSignature_data();
void shouldReplaceSignature();
};