Commit 9b9bc829 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotest

parent 0b2c490a
Pipeline #201341 passed with stage
in 13 minutes and 47 seconds
# SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
macro(add_kmail_akonadidatabasetoolsplugin_unittest _source _additional)
set( _test ${_source} ${_additional})
macro(add_kmail_akonadidatabasetoolsplugin_unittest _source)
set( _test ${_source})
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_executable( ${_name} ${_test} ${_name}.h)
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kmail_antivirusplugin-${_name})
......@@ -11,4 +11,6 @@ macro(add_kmail_akonadidatabasetoolsplugin_unittest _source _additional)
KF5::MailCommon KF5::Libkdepim KF5::I18n KF5::GuiAddons akonadidatasetools)
endmacro ()
add_kmail_akonadidatabasetoolsplugin_unittest(akonadidatabasetoolsplugininterfacetest.cpp "")
add_kmail_akonadidatabasetoolsplugin_unittest(akonadidatabasetoolsplugininterfacetest.cpp)
add_kmail_akonadidatabasetoolsplugin_unittest(akonadidatabasetoolswidgettest.cpp)
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "akonadidatabasetoolswidgettest.h"
#include "akonadidatabasetoolswidget.h"
#include <QPlainTextEdit>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(AkonadiDatabaseToolsWidgetTest)
AkonadiDatabaseToolsWidgetTest::AkonadiDatabaseToolsWidgetTest(QObject *parent)
: QObject{parent}
{
}
void AkonadiDatabaseToolsWidgetTest::shouldHaveDefaultValues()
{
AkonadiDatabaseToolsWidget w;
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), QMargins{});
auto mPlainTextEdit = w.findChild<QPlainTextEdit *>(QStringLiteral("mPlainTextEdit"));
QVERIFY(mPlainTextEdit);
QVERIFY(mPlainTextEdit->toPlainText().isEmpty());
}
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
class AkonadiDatabaseToolsWidgetTest : public QObject
{
Q_OBJECT
public:
explicit AkonadiDatabaseToolsWidgetTest(QObject *parent = nullptr);
~AkonadiDatabaseToolsWidgetTest() override = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
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