File indexing completed on 2025-01-19 04:46:54

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "standardsheaderstyleplugintest.h"
0008 #include "../standardsheaderstyleplugin/standardsheaderstyleinterface.h"
0009 #include "../standardsheaderstyleplugin/standardsheaderstyleplugin.h"
0010 #include <KActionCollection>
0011 #include <KActionMenu>
0012 #include <QActionGroup>
0013 #include <QTest>
0014 
0015 StandardsHeaderStylePluginTest::StandardsHeaderStylePluginTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 StandardsHeaderStylePluginTest::~StandardsHeaderStylePluginTest() = default;
0021 
0022 void StandardsHeaderStylePluginTest::shouldHaveDefaultValue()
0023 {
0024     MessageViewer::StandardsHeaderStylePlugin plugin;
0025     QVERIFY(plugin.headerStyle());
0026     QVERIFY(plugin.headerStrategy());
0027 }
0028 
0029 void StandardsHeaderStylePluginTest::shouldCreateInterface()
0030 {
0031     MessageViewer::StandardsHeaderStylePlugin 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(StandardsHeaderStylePluginTest)
0042 
0043 #include "moc_standardsheaderstyleplugintest.cpp"