Commit 83c26ec4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotests for signature

parent e53831ad
......@@ -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)
......@@ -38,6 +38,7 @@ private Q_SLOTS:
void shouldForceAutoCorrectionWithSelection();
void shouldNotChangeSignatureWhenOriginalAndNewSignatureAreSame();
void shouldAddSignature();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment