File indexing completed on 2024-12-22 04:45:45

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "statuscomboboxtest.h"
0008 #include "misc/statuscombobox.h"
0009 #include <QTest>
0010 QTEST_MAIN(StatusComboboxTest)
0011 StatusComboboxTest::StatusComboboxTest(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 void StatusComboboxTest::shouldHaveDefaultValues()
0017 {
0018     StatusCombobox w;
0019     w.setUseOnlyStandardStatus();
0020     QCOMPARE(w.count(), 4);
0021 }
0022 
0023 void StatusComboboxTest::shouldSelectStatus()
0024 {
0025     StatusCombobox w;
0026     w.setUseOnlyStandardStatus();
0027     w.setStatus(User::PresenceStatus::PresenceOffline);
0028     QCOMPARE(w.currentIndex(), 3);
0029 
0030     w.setStatus(User::PresenceStatus::PresenceAway);
0031     QCOMPARE(w.currentIndex(), 2);
0032 }
0033 
0034 #include "moc_statuscomboboxtest.cpp"