Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
libksieve
Commits
916afb8c
Commit
916afb8c
authored
Jun 30, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add autotest
parent
3c432f59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
1 deletion
+110
-1
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
+108
-0
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
+2
-1
No files found.
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
View file @
916afb8c
...
...
@@ -20,7 +20,14 @@
#include "vacationeditwidgettest.h"
#include "../vacationeditwidget.h"
#include <KDateComboBox>
#include <KTimeComboBox>
#include <QCheckBox>
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
#include <QTest>
#include <kpimtextedit/plaintexteditorwidget.h>
VacationEditWidgetTest
::
VacationEditWidgetTest
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -33,4 +40,105 @@ VacationEditWidgetTest::~VacationEditWidgetTest()
}
void
VacationEditWidgetTest
::
shouldHaveDefaultValue
()
{
KSieveUi
::
VacationEditWidget
w
;
QLabel
*
configureVacationLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"configureVacationLabel"
));
QVERIFY
(
configureVacationLabel
);
QVERIFY
(
!
configureVacationLabel
->
text
().
isEmpty
());
QCheckBox
*
mActiveCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mActiveCheck"
));
QVERIFY
(
mActiveCheck
);
QVERIFY
(
!
mActiveCheck
->
text
().
isEmpty
());
QVERIFY
(
!
mActiveCheck
->
isChecked
());
KPIMTextEdit
::
PlainTextEditorWidget
*
mTextEdit
=
w
.
findChild
<
KPIMTextEdit
::
PlainTextEditorWidget
*>
(
QStringLiteral
(
"mTextEdit"
));
QVERIFY
(
mTextEdit
);
QVERIFY
(
mTextEdit
->
toPlainText
().
isEmpty
());
QLineEdit
*
mSubject
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mSubject"
));
QVERIFY
(
mSubject
);
QVERIFY
(
mSubject
->
text
().
isEmpty
());
QVERIFY
(
mSubject
->
isClearButtonEnabled
());
QLabel
*
subjectOfVacationLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"subjectOfVacationLabel"
));
QVERIFY
(
subjectOfVacationLabel
);
QVERIFY
(
!
subjectOfVacationLabel
->
text
().
isEmpty
());
KDateComboBox
*
mStartDate
=
w
.
findChild
<
KDateComboBox
*>
(
QStringLiteral
(
"mStartDate"
));
QVERIFY
(
mStartDate
);
QVERIFY
(
mStartDate
->
isEnabled
());
QCheckBox
*
mStartTimeActive
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mStartTimeActive"
));
QVERIFY
(
mStartTimeActive
);
QVERIFY
(
!
mStartTimeActive
->
isChecked
());
QLabel
*
mStartDateLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"mStartDateLabel"
));
QVERIFY
(
mStartDateLabel
);
QVERIFY
(
!
mStartDateLabel
->
text
().
isEmpty
());
KDateComboBox
*
mEndDate
=
w
.
findChild
<
KDateComboBox
*>
(
QStringLiteral
(
"mEndDate"
));
QVERIFY
(
mEndDate
);
KTimeComboBox
*
mEndTime
=
w
.
findChild
<
KTimeComboBox
*>
(
QStringLiteral
(
"mEndTime"
));
QVERIFY
(
mEndTime
);
QVERIFY
(
!
mEndTime
->
isEnabled
());
QCheckBox
*
mEndTimeActive
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mEndTimeActive"
));
QVERIFY
(
mEndTimeActive
);
QVERIFY
(
!
mEndTimeActive
->
isChecked
());
QLabel
*
mEndDateLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"mEndDateLabel"
));
QVERIFY
(
mEndDateLabel
);
QVERIFY
(
!
mEndDateLabel
->
text
().
isEmpty
());
QSpinBox
*
mIntervalSpin
=
w
.
findChild
<
QSpinBox
*>
(
QStringLiteral
(
"mIntervalSpin"
));
QVERIFY
(
mIntervalSpin
);
QLabel
*
resendNotificationLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"resendNotificationLabel"
));
QVERIFY
(
resendNotificationLabel
);
QVERIFY
(
!
resendNotificationLabel
->
text
().
isEmpty
());
QLineEdit
*
mMailAliasesEdit
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mMailAliasesEdit"
));
QVERIFY
(
mMailAliasesEdit
);
QVERIFY
(
mMailAliasesEdit
->
text
().
isEmpty
());
QVERIFY
(
mMailAliasesEdit
->
isClearButtonEnabled
());
QLabel
*
sendResponseLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"sendResponseLabel"
));
QVERIFY
(
sendResponseLabel
);
QVERIFY
(
!
sendResponseLabel
->
text
().
isEmpty
());
// Action for incoming mails
QComboBox
*
mMailAction
=
w
.
findChild
<
QComboBox
*>
(
QStringLiteral
(
"mMailAction"
));
QVERIFY
(
mMailAction
);
QCOMPARE
(
mMailAction
->
count
(),
4
);
QLineEdit
*
mMailActionRecipient
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mMailActionRecipient"
));
QVERIFY
(
mMailActionRecipient
);
QVERIFY
(
mMailActionRecipient
->
text
().
isEmpty
());
QVERIFY
(
!
mMailActionRecipient
->
isEnabled
());
QVERIFY
(
mMailActionRecipient
->
isClearButtonEnabled
());
QLabel
*
actionIncomingMailsLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"actionIncomingMailsLabel"
));
QVERIFY
(
actionIncomingMailsLabel
);
QVERIFY
(
!
actionIncomingMailsLabel
->
text
().
isEmpty
());
QCheckBox
*
mSpamCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mSpamCheck"
));
QVERIFY
(
mSpamCheck
);
QVERIFY
(
!
mSpamCheck
->
text
().
isEmpty
());
QVERIFY
(
mSpamCheck
->
isChecked
());
QCheckBox
*
mDomainCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mDomainCheck"
));
QVERIFY
(
mDomainCheck
);
QVERIFY
(
!
mDomainCheck
->
text
().
isEmpty
());
QVERIFY
(
!
mDomainCheck
->
isChecked
());
QLineEdit
*
mDomainEdit
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mDomainEdit"
));
QVERIFY
(
mDomainEdit
);
QVERIFY
(
mDomainEdit
->
text
().
isEmpty
());
QVERIFY
(
!
mDomainEdit
->
isEnabled
());
QVERIFY
(
mDomainEdit
->
isClearButtonEnabled
());
}
QTEST_MAIN
(
VacationEditWidgetTest
)
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
View file @
916afb8c
...
...
@@ -29,7 +29,8 @@ class VacationEditWidgetTest : public QObject
public:
explicit
VacationEditWidgetTest
(
QObject
*
parent
=
Q_NULLPTR
);
~
VacationEditWidgetTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif // VACATIONEDITWIDGETTEST_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment