File indexing completed on 2024-12-22 04:28:24
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #include "speechtotextconfigurewidgettest.h" 0007 #include "speechtotext/widgets/speechtotextcomboboxwidget.h" 0008 #include "speechtotext/widgets/speechtotextconfigurewidget.h" 0009 #include "speechtotext/widgets/speechtotextselectdevicewidget.h" 0010 #include <QStandardPaths> 0011 #include <QTest> 0012 #include <QVBoxLayout> 0013 QTEST_MAIN(SpeechToTextConfigureWidgetTest) 0014 SpeechToTextConfigureWidgetTest::SpeechToTextConfigureWidgetTest(QObject *parent) 0015 : QObject{parent} 0016 { 0017 QStandardPaths::setTestModeEnabled(true); 0018 } 0019 0020 void SpeechToTextConfigureWidgetTest::shouldHaveDefaultValues() 0021 { 0022 TextSpeechToText::SpeechToTextConfigureWidget w; 0023 0024 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0025 QVERIFY(mainLayout); 0026 QCOMPARE(mainLayout->contentsMargins(), QMargins{}); 0027 0028 auto mSpeechToTextComboBox = w.findChild<TextSpeechToText::SpeechToTextComboBoxWidget *>(QStringLiteral("mSpeechToTextComboBox")); 0029 QVERIFY(mSpeechToTextComboBox); 0030 0031 auto mSpeechToTextDevice = w.findChild<TextSpeechToText::SpeechToTextSelectDeviceWidget *>(QStringLiteral("mSpeechToTextDevice")); 0032 QVERIFY(mSpeechToTextDevice); 0033 } 0034 0035 #include "moc_speechtotextconfigurewidgettest.cpp"