remotecontentdialogtest.cpp 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
/*
   SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#include "remotecontentdialogtest.h"
#include "remote-content/remotecontentdialog.h"
Laurent Montel's avatar
Laurent Montel committed
9
10
#include "remote-content/remotecontentwidget.h"
#include <QDialogButtonBox>
11
#include <QTest>
Laurent Montel's avatar
Laurent Montel committed
12
#include <QVBoxLayout>
13
14
15
16
17
18
19
20
21
QTEST_MAIN(RemoteContentDialogTest)

RemoteContentDialogTest::RemoteContentDialogTest(QObject *parent)
    : QObject(parent)
{
}

void RemoteContentDialogTest::shouldHaveDefaultValues()
{
Laurent Montel's avatar
Laurent Montel committed
22
23
    MessageViewer::RemoteContentDialog w;

Laurent Montel's avatar
Laurent Montel committed
24
    QVERIFY(w.windowTitle().isEmpty());
Laurent Montel's avatar
Laurent Montel committed
25
26
27
28
29
30
31
32
33
34

    auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
    QVERIFY(mainLayout);

    auto mRemoveContentWidget = w.findChild<MessageViewer::RemoteContentWidget *>(QStringLiteral("mRemoveContentWidget"));
    QVERIFY(mRemoveContentWidget);

    auto buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
    QVERIFY(buttonBox);
    QCOMPARE(buttonBox->standardButtons(), {QDialogButtonBox::Ok | QDialogButtonBox::Cancel});
35
}