File indexing completed on 2024-11-24 04:16:53
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "translatorconfigurecombowidgettest.h" 0008 #include "translator/widgets/translatorconfigurecombowidget.h" 0009 #include <QComboBox> 0010 #include <QHBoxLayout> 0011 #include <QStandardPaths> 0012 #include <QTest> 0013 #include <QToolButton> 0014 QTEST_MAIN(TranslatorConfigureComboWidgetTest) 0015 TranslatorConfigureComboWidgetTest::TranslatorConfigureComboWidgetTest(QObject *parent) 0016 : QObject{parent} 0017 { 0018 QStandardPaths::setTestModeEnabled(true); 0019 } 0020 0021 void TranslatorConfigureComboWidgetTest::shouldHaveDefaultValues() 0022 { 0023 TextTranslator::TranslatorConfigureComboWidget d; 0024 auto mEngineComboBox = d.findChild<QComboBox *>(QStringLiteral("mEngineComboBox")); 0025 QVERIFY(mEngineComboBox); 0026 auto mConfigureEngine = d.findChild<QToolButton *>(QStringLiteral("mConfigureEngine")); 0027 QVERIFY(mConfigureEngine); 0028 0029 auto mainLayout = d.findChild<QHBoxLayout *>(QStringLiteral("mainLayout")); 0030 QVERIFY(mainLayout); 0031 QCOMPARE(mainLayout->contentsMargins(), QMargins{}); 0032 0033 // FIXME it depends against plugin. First is bergamot => enabled. Before google => disable 0034 // QVERIFY(!mConfigureEngine->isEnabled()); 0035 } 0036 0037 #include "moc_translatorconfigurecombowidgettest.cpp"