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 a2fd237e authored by Laurent Montel's avatar Laurent Montel 😁

improve unittest

parent b23d8d3b
......@@ -21,6 +21,7 @@
#include "../emaileditwidget.h"
#include <qtest_kde.h>
#include <KListWidget>
#include <qpushbutton.h>
EmailEditDialogTest::EmailEditDialogTest(QObject *parent)
: QObject(parent)
{
......@@ -38,6 +39,15 @@ void EmailEditDialogTest::shouldHaveDefaultValue()
KListWidget *listwidget = qFindChild<KListWidget *>(&dlg, QLatin1String("emailListBox"));
QVERIFY(listwidget);
QCOMPARE(listwidget->count(), 0);
QPushButton *button = qFindChild<QPushButton *>(&dlg, QLatin1String("add"));
QVERIFY(button);
button = qFindChild<QPushButton *>(&dlg, QLatin1String("remove"));
QVERIFY(button);
button = qFindChild<QPushButton *>(&dlg, QLatin1String("edit"));
QVERIFY(button);
button = qFindChild<QPushButton *>(&dlg, QLatin1String("standard"));
QVERIFY(button);
}
void EmailEditDialogTest::shouldAddItems()
......
......@@ -206,20 +206,24 @@ EmailEditDialog::EmailEditDialog(QWidget *parent)
topLayout->addWidget(mEmailListBox, 0, 0, 5, 2);
mAddButton = new QPushButton(i18n("Add..."), page);
mAddButton->setObjectName(QLatin1String("add"));
connect(mAddButton, SIGNAL(clicked()), SLOT(add()));
topLayout->addWidget(mAddButton, 0, 2);
mEditButton = new QPushButton(i18n("Edit..."), page);
mEditButton->setObjectName(QLatin1String("edit"));
mEditButton->setEnabled(false);
connect(mEditButton, SIGNAL(clicked()), SLOT(edit()));
topLayout->addWidget(mEditButton, 1, 2);
mRemoveButton = new QPushButton(i18n("Remove"), page);
mRemoveButton->setObjectName(QLatin1String("remove"));
mRemoveButton->setEnabled(false);
connect(mRemoveButton, SIGNAL(clicked()), SLOT(remove()));
topLayout->addWidget(mRemoveButton, 2, 2);
mStandardButton = new QPushButton(i18n("Set as Standard"), page);
mStandardButton->setObjectName(QLatin1String("standard"));
mStandardButton->setEnabled(false);
connect(mStandardButton, SIGNAL(clicked()), SLOT(standard()));
topLayout->addWidget(mStandardButton, 3, 2);
......
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