Commit 8eb7526f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotest

parent f7405829
......@@ -9,3 +9,4 @@ macro(add_kmail_checkbeforedeleting_unittest _source)
endmacro ()
add_kmail_checkbeforedeleting_unittest(confirmbeforedeletingdialogtest.cpp)
add_kmail_checkbeforedeleting_unittest(confirmbeforedeletingwidgettest.cpp)
......@@ -6,15 +6,28 @@
#include "confirmbeforedeletingdialogtest.h"
#include "confirmbeforedeletingdialog.h"
#include "confirmbeforedeletingwidget.h"
#include <QDialogButtonBox>
#include <QStandardPaths>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(ConfirmBeforeDeletingDialogTest)
ConfirmBeforeDeletingDialogTest::ConfirmBeforeDeletingDialogTest(QObject *parent)
: QObject(parent)
{
QStandardPaths::setTestModeEnabled(true);
}
void ConfirmBeforeDeletingDialogTest::shouldHaveDefaultValues()
{
ConfirmBeforeDeletingDialog d;
// TODO
QVERIFY(!d.windowTitle().isEmpty());
auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
auto mConfirmBeforeDeletingWidget = d.findChild<ConfirmBeforeDeletingWidget *>(QStringLiteral("mConfirmBeforeDeletingWidget"));
QVERIFY(mConfirmBeforeDeletingWidget);
auto buttonBox = d.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
QVERIFY(buttonBox);
}
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "confirmbeforedeletingwidgettest.h"
#include "confirmbeforedeletingwidget.h"
#include <QTest>
QTEST_MAIN(ConfirmBeforeDeletingWidgetTest)
ConfirmBeforeDeletingWidgetTest::ConfirmBeforeDeletingWidgetTest(QObject *parent)
: QObject(parent)
{
}
void ConfirmBeforeDeletingWidgetTest::shouldHaveDefaultValues()
{
ConfirmBeforeDeletingWidget w;
// TODO
}
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include <QObject>
class ConfirmBeforeDeletingWidgetTest : public QObject
{
Q_OBJECT
public:
explicit ConfirmBeforeDeletingWidgetTest(QObject *parent = nullptr);
~ConfirmBeforeDeletingWidgetTest() override = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
Markdown is supported
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