File indexing completed on 2025-01-05 04:49:43

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "longheaderstyleplugintest.h"
0008 #include "../longheaderstyleplugin/longheaderstyleinterface.h"
0009 #include "../longheaderstyleplugin/longheaderstyleplugin.h"
0010 #include <KActionCollection>
0011 #include <KActionMenu>
0012 #include <QActionGroup>
0013 #include <QTest>
0014 
0015 LongHeaderStylePluginTest::LongHeaderStylePluginTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 LongHeaderStylePluginTest::~LongHeaderStylePluginTest() = default;
0021 
0022 void LongHeaderStylePluginTest::shouldHaveDefaultValue()
0023 {
0024     MessageViewer::LongHeaderStylePlugin plugin;
0025     QVERIFY(plugin.headerStyle());
0026     QVERIFY(plugin.headerStrategy());
0027 }
0028 
0029 void LongHeaderStylePluginTest::shouldCreateInterface()
0030 {
0031     MessageViewer::LongHeaderStylePlugin plugin;
0032     auto menu = new KActionMenu(this);
0033     auto act = new QActionGroup(this);
0034 
0035     MessageViewer::HeaderStyleInterface *interface = plugin.createView(menu, act, new KActionCollection(this));
0036     QVERIFY(interface);
0037     QVERIFY(!interface->action().isEmpty());
0038     delete interface;
0039 }
0040 
0041 QTEST_MAIN(LongHeaderStylePluginTest)
0042 
0043 #include "moc_longheaderstyleplugintest.cpp"