Commit 90e7582d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotests

parent 5079b600
Pipeline #69174 canceled with stage
......@@ -7,6 +7,8 @@
#include "confirmbeforedeletingwidgettest.h"
#include "confirmbeforedeletingwidget.h"
#include <QTest>
#include <QTreeWidget>
#include <QVBoxLayout>
QTEST_MAIN(ConfirmBeforeDeletingWidgetTest)
ConfirmBeforeDeletingWidgetTest::ConfirmBeforeDeletingWidgetTest(QObject *parent)
......@@ -17,5 +19,13 @@ ConfirmBeforeDeletingWidgetTest::ConfirmBeforeDeletingWidgetTest(QObject *parent
void ConfirmBeforeDeletingWidgetTest::shouldHaveDefaultValues()
{
ConfirmBeforeDeletingWidget w;
// TODO
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), {});
auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("mTreeWidget"));
QVERIFY(mTreeWidget->alternatingRowColors());
QVERIFY(!mTreeWidget->rootIsDecorated());
QCOMPARE(mTreeWidget->contextMenuPolicy(), Qt::CustomContextMenu);
}
......@@ -22,6 +22,7 @@ ConfirmBeforeDeletingWidget::ConfirmBeforeDeletingWidget(QWidget *parent)
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mTreeWidget->setObjectName(QStringLiteral("mTreeWidget"));
mainLayout->addWidget(mTreeWidget);
mTreeWidget->setAlternatingRowColors(true);
mTreeWidget->setRootIsDecorated(false);
......
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