File indexing completed on 2024-11-24 04:39:30

0001 /*
0002     This file is part of Contact Editor.
0003 
0004     SPDX-FileCopyrightText: 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
0005     SPDX-FileCopyrightText: 2016-2020 Laurent Montel <montel.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #include "phonewidgettest.h"
0011 #include "../phone/phonecomboboxtype.h"
0012 #include "../phone/phonewidget.h"
0013 #include <QLineEdit>
0014 #include <QTest>
0015 #include <QToolButton>
0016 
0017 PhoneWidgetTest::PhoneWidgetTest(QObject *parent)
0018     : QObject(parent)
0019 {
0020 }
0021 
0022 PhoneWidgetTest::~PhoneWidgetTest() = default;
0023 
0024 void PhoneWidgetTest::shouldHaveDefaultValue()
0025 {
0026     Akonadi::PhoneWidget w;
0027     auto line = w.findChild<QLineEdit *>(QStringLiteral("phonenumber"));
0028     QVERIFY(line);
0029     auto addButton = w.findChild<QToolButton *>(QStringLiteral("addbutton"));
0030     QVERIFY(addButton);
0031 
0032     auto combotype = w.findChild<Akonadi::PhoneComboBoxType *>(QStringLiteral("phonetype"));
0033     QVERIFY(combotype);
0034 
0035     auto removeButton = w.findChild<QToolButton *>(QStringLiteral("removebutton"));
0036     QVERIFY(removeButton);
0037 }
0038 
0039 QTEST_MAIN(PhoneWidgetTest)
0040 
0041 #include "moc_phonewidgettest.cpp"