Commit 9fa678ec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

improve autotest

parent 575aa2f8
......@@ -6,7 +6,10 @@
#include "textreplacewidgettest.h"
#include "texteditor/commonwidget/textfindreplacewidget.h"
#include <QLineEdit>
#include <QPushButton>
#include <QTest>
QTEST_MAIN(TextReplaceWidgetTest)
TextReplaceWidgetTest::TextReplaceWidgetTest(QObject *parent)
: QObject{parent}
......@@ -17,4 +20,16 @@ void TextReplaceWidgetTest::shouldHaveDefaultValues()
{
KPIMTextEdit::TextReplaceWidget w;
QVERIFY(w.replaceLineEdit());
auto mReplace = w.findChild<QLineEdit *>(QStringLiteral("mReplace"));
QVERIFY(mReplace);
QVERIFY(mReplace->isClearButtonEnabled());
QVERIFY(mReplace->text().isEmpty());
auto mReplaceBtn = w.findChild<QPushButton *>(QStringLiteral("mReplaceBtn"));
QVERIFY(mReplaceBtn);
QVERIFY(!mReplaceBtn->text().isEmpty());
auto mReplaceAllBtn = w.findChild<QPushButton *>(QStringLiteral("mReplaceAllBtn"));
QVERIFY(mReplaceAllBtn);
QVERIFY(!mReplaceAllBtn->text().isEmpty());
}
......@@ -34,6 +34,10 @@ TextReplaceWidget::TextReplaceWidget(QWidget *parent)
mReplace->setClearButtonEnabled(true);
lay->addWidget(mReplace);
mReplace->setObjectName(QStringLiteral("mReplace"));
mReplaceBtn->setObjectName(QStringLiteral("mReplaceBtn"));
mReplaceAllBtn->setObjectName(QStringLiteral("mReplaceAllBtn"));
connect(mReplaceBtn, &QPushButton::clicked, this, &TextReplaceWidget::replaceText);
lay->addWidget(mReplaceBtn);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment