File indexing completed on 2024-05-12 16:15:57
0001 /* 0002 SPDX-FileCopyrightText: 2022-2023 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "texttospeechsliderwidgettest.h" 0008 #include "texttospeechsliderwidget.h" 0009 #include <QHBoxLayout> 0010 #include <QLabel> 0011 #include <QSlider> 0012 #include <QTest> 0013 QTEST_MAIN(TextToSpeechSliderWidgetTest) 0014 TextToSpeechSliderWidgetTest::TextToSpeechSliderWidgetTest(QObject *parent) 0015 : QObject{parent} 0016 { 0017 } 0018 0019 void TextToSpeechSliderWidgetTest::shouldHaveDefaultValues() 0020 { 0021 TextEditTextToSpeech::TextToSpeechSliderWidget w({}); 0022 auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout")); 0023 QVERIFY(mainLayout); 0024 QCOMPARE(mainLayout->contentsMargins(), QMargins{}); 0025 0026 auto mLabel = w.findChild<QLabel *>(QStringLiteral("mLabel")); 0027 QVERIFY(mLabel); 0028 0029 auto mSlider = w.findChild<QSlider *>(QStringLiteral("mSlider")); 0030 QVERIFY(mSlider); 0031 QCOMPARE(mSlider->orientation(), Qt::Horizontal); 0032 } 0033 0034 #include "moc_texttospeechsliderwidgettest.cpp"