diff --git a/plugins/messageviewerheaderplugins/autotests/data/allheaders.mbox.enterprise.html b/plugins/messageviewerheaderplugins/autotests/data/allheaders.mbox.enterprise.html
index ba444830..efb12513 100644
--- a/plugins/messageviewerheaderplugins/autotests/data/allheaders.mbox.enterprise.html
+++ b/plugins/messageviewerheaderplugins/autotests/data/allheaders.mbox.enterprise.html
@@ -1,72 +1,73 @@
NBSP_ENTITY_PLACEHOLDER
NBSP_ENTITY_PLACEHOLDER
21 May 2018 16:52:43
+
diff --git a/plugins/messageviewerheaderplugins/autotests/data/empty.enterprise.html b/plugins/messageviewerheaderplugins/autotests/data/empty.enterprise.html
index 2b28f6e1..e8f4bf15 100644
--- a/plugins/messageviewerheaderplugins/autotests/data/empty.enterprise.html
+++ b/plugins/messageviewerheaderplugins/autotests/data/empty.enterprise.html
@@ -1,58 +1,59 @@
NBSP_ENTITY_PLACEHOLDER
NBSP_ENTITY_PLACEHOLDER
Unknown
+
diff --git a/plugins/messageviewerheaderplugins/autotests/data/headertest.mbox.enterprise.html b/plugins/messageviewerheaderplugins/autotests/data/headertest.mbox.enterprise.html
index f7791116..3586ac26 100644
--- a/plugins/messageviewerheaderplugins/autotests/data/headertest.mbox.enterprise.html
+++ b/plugins/messageviewerheaderplugins/autotests/data/headertest.mbox.enterprise.html
@@ -1,66 +1,67 @@
NBSP_ENTITY_PLACEHOLDER
NBSP_ENTITY_PLACEHOLDER
21 May 2018 16:52:43
|
|
|
|
|
No Subject |
From: |
admin <admin@ssrr.link>, from2 <from2@example.org>, from3 <from3@example.org>, from4 <from4@example.org>, from5 <from5@example.org>, from6 <from6@example.org> |
To: |
direct recipient1 <tospam1@example.org>, direct recipient2 <tospam2@example.org>, direct recipient3 <tospam3@example.org>, direct recipient4 <tospam4@example.org>, direct recipient5 <tospam5@example.org>, direct recipient6 <tospam6@example.org> |
CC: |
copy recipient1 <ccspam1@example.org>, copy recipient2 <ccspam2@example.org>, copy recipient3 <ccspam3@example.org>, copy recipient4 <ccspam4@example.org>, copy recipient5 <ccspam5@example.org>, copy recipient6 <ccspam6@example.org> |
BCC: |
blind copy recipient1 <bccspam1@example.org>, blind copy recipient2 <bccspam2@example.org>, blind copy recipient3 <bccspam3@example.org>, blind copy recipient4 <bccspam4@example.org>, blind copy recipient5 <bccspam5@example.org>, blind copy recipient6 <bccspam6@example.org> |
|
|
|
|
|
|
|
|
+
diff --git a/plugins/messageviewerheaderplugins/autotests/enterpriseheaderstyleplugintest.cpp b/plugins/messageviewerheaderplugins/autotests/enterpriseheaderstyleplugintest.cpp
index 81e57e7d..6e332ddf 100644
--- a/plugins/messageviewerheaderplugins/autotests/enterpriseheaderstyleplugintest.cpp
+++ b/plugins/messageviewerheaderplugins/autotests/enterpriseheaderstyleplugintest.cpp
@@ -1,94 +1,96 @@
/*
Copyright (C) 2015-2019 Montel Laurent
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "enterpriseheaderstyleplugintest.h"
#include "utils.h"
#include "../enterpriseheaderstyleplugin/enterpriseheaderstyleplugin.h"
#include "../enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h"
#include
#include
#include
#include
#include
EnterpriseHeaderStylePluginTest::EnterpriseHeaderStylePluginTest(QObject *parent)
: QObject(parent)
{
}
EnterpriseHeaderStylePluginTest::~EnterpriseHeaderStylePluginTest()
{
}
void EnterpriseHeaderStylePluginTest::shouldHaveDefaultValue()
{
MessageViewer::EnterpriseHeaderStylePlugin plugin;
QVERIFY(plugin.headerStyle());
QVERIFY(plugin.headerStrategy());
}
void EnterpriseHeaderStylePluginTest::shouldCreateInterface()
{
MessageViewer::EnterpriseHeaderStylePlugin plugin;
KActionMenu *menu = new KActionMenu(this);
QActionGroup *act = new QActionGroup(this);
MessageViewer::HeaderStyleInterface *interface = plugin.createView(menu, act, new KActionCollection(this));
QVERIFY(interface);
QVERIFY(!interface->action().isEmpty());
}
void EnterpriseHeaderStylePluginTest::testFormatEmpty()
{
MessageViewer::EnterpriseHeaderStylePlugin plugin;
auto style = plugin.headerStyle();
auto strategy = plugin.headerStrategy();
style->setHeaderStrategy(strategy);
QCOMPARE(style->headerStrategy(), strategy);
auto aMsg = new KMime::Message();
- testHeaderFile(style->format(aMsg), QStringLiteral("empty.enterprise"));
+ QString closedDiv = style->format(aMsg) + QStringLiteral("");
+ testHeaderFile(closedDiv, QStringLiteral("empty.enterprise"));
}
void EnterpriseHeaderStylePluginTest::testFormat_data()
{
QTest::addColumn("mailbox");
QDir dir(QStringLiteral(HEADER_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
for (const QString &file : l) {
QTest::newRow(file.toLatin1().constData()) << file;
}
}
void EnterpriseHeaderStylePluginTest::testFormat()
{
QFETCH(QString, mailbox);
MessageViewer::EnterpriseHeaderStylePlugin plugin;
auto style = plugin.headerStyle();
auto strategy = plugin.headerStrategy();
style->setHeaderStrategy(strategy);
QCOMPARE(style->headerStrategy(), strategy);
auto aMsg = readAndParseMail(mailbox);
- testHeaderFile(style->format(aMsg.data()), mailbox+QStringLiteral(".enterprise"));
+ QString closedDiv = style->format(aMsg.data()) + QStringLiteral("");
+ testHeaderFile(closedDiv, mailbox+QStringLiteral(".enterprise"));
}
QTEST_MAIN(EnterpriseHeaderStylePluginTest)