Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 78651887 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent fdff178a
......@@ -32,10 +32,12 @@ AttachmentMissingWarning::AttachmentMissingWarning(QWidget *parent)
setWordWrap(true);
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("mail-attachment")), i18n("&Attach file"), this);
action->setObjectName(QStringLiteral("attachfileaction"));
connect(action, &QAction::triggered, this, &AttachmentMissingWarning::slotAttachFile);
addAction(action);
action = new QAction(QIcon::fromTheme(QStringLiteral("window-close")), i18n("&Remind me later"), this);
action->setObjectName(QStringLiteral("remindmelater"));
connect(action, &QAction::triggered, this, &AttachmentMissingWarning::explicitlyClosed);
addAction(action);
}
......
......@@ -5,3 +5,10 @@ add_executable( kmail_incorrectidentityfolderwarningtest ${kmail_incorrectidenti
add_test(NAME kmail_incorrectidentityfolderwarningtest COMMAND kmail_incorrectidentityfolderwarningtest)
ecm_mark_as_test(kmail_incorrectidentityfolderwarningtest)
target_link_libraries( kmail_incorrectidentityfolderwarningtest Qt5::Test KF5::PimCommon KF5::I18n)
set( kmail_externaleditorwarningtest_SRCS externaleditorwarningtest.cpp ../externaleditorwarning.cpp )
add_executable( kmail_externaleditorwarningtest ${kmail_externaleditorwarningtest_SRCS})
add_test(NAME kmail_externaleditorwarningtest COMMAND kmail_externaleditorwarningtest)
ecm_mark_as_test(kmail_externaleditorwarningtest)
target_link_libraries( kmail_externaleditorwarningtest Qt5::Test KF5::PimCommon KF5::I18n)
/*
Copyright (C) 2017 Montel Laurent <montel@kde.org>
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 "externaleditorwarningtest.h"
#include "../externaleditorwarning.h"
#include <QHBoxLayout>
#include <QTest>
QTEST_MAIN(ExternalEditorWarningTest)
ExternalEditorWarningTest::ExternalEditorWarningTest(QObject *parent)
: QObject(parent)
{
}
void ExternalEditorWarningTest::shouldHaveDefaultValue()
{
QWidget *wid = new QWidget;
QHBoxLayout *layout = new QHBoxLayout(wid);
ExternalEditorWarning w;
layout->addWidget(&w);
wid->show();
QVERIFY(!w.isVisible());
//QVERIFY(w.isCloseButtonVisible());
QCOMPARE(w.messageType(), KMessageWidget::Information);
QVERIFY(w.wordWrap());
QVERIFY(!w.text().isEmpty());
}
/*
Copyright (C) 2017 Montel Laurent <montel@kde.org>
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.
*/
#ifndef EXTERNALEDITORWARNINGTEST_H
#define EXTERNALEDITORWARNINGTEST_H
#include <QObject>
class ExternalEditorWarningTest : public QObject
{
Q_OBJECT
public:
explicit ExternalEditorWarningTest(QObject *parent = nullptr);
~ExternalEditorWarningTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // EXTERNALEDITORWARNINGTEST_H
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