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

improve autotest

parent 48a59616
set(emaileditdialogtesttest_SRCS emaileditdialogtest.cpp)
set(emaileditdialogtesttest_SRCS emaileditdialogtest.cpp ../emaileditwidget.cpp)
kde4_add_unit_test(emaileditdialogtest TESTNAME emaileditdialogtest ${emaileditdialogtesttest_SRCS})
target_link_libraries(emaileditdialogtest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS})
target_link_libraries(emaileditdialogtest ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} kpimutils kabc)
......@@ -18,7 +18,9 @@
*/
#include "emaileditdialogtest.h"
#include "../emaileditwidget.h"
#include <qtest_kde.h>
#include <KListWidget>
EmailEditDialogTest::EmailEditDialogTest(QObject *parent)
: QObject(parent)
{
......@@ -30,4 +32,11 @@ EmailEditDialogTest::~EmailEditDialogTest()
}
void EmailEditDialogTest::shouldHaveDefaultValue()
{
EmailEditDialog dlg;
KListWidget *listwidget = qFindChild<KListWidget *>(&dlg, QLatin1String("emailListBox"));
QVERIFY(listwidget);
}
QTEST_KDEMAIN(EmailEditDialogTest, GUI)
......@@ -30,6 +30,9 @@ public:
explicit EmailEditDialogTest(QObject *parent = 0);
~EmailEditDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // EMAILEDITDIALOGTEST_H
......@@ -194,6 +194,7 @@ EmailEditDialog::EmailEditDialog(QWidget *parent)
topLayout->setMargin(0);
mEmailListBox = new KListWidget(page);
mEmailListBox->setObjectName(QLatin1String("emailListBox"));
mEmailListBox->setSelectionMode(QAbstractItemView::SingleSelection);
// Make sure there is room for the scrollbar
......
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