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
60d0f1a4
Commit
60d0f1a4
authored
Jun 30, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more autotests
parent
916afb8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
1 deletion
+85
-1
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
+84
-1
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
+1
-0
No files found.
src/ksieveui/vacation/autotests/vacationeditwidgettest.cpp
View file @
60d0f1a4
...
@@ -42,7 +42,6 @@ VacationEditWidgetTest::~VacationEditWidgetTest()
...
@@ -42,7 +42,6 @@ VacationEditWidgetTest::~VacationEditWidgetTest()
void
VacationEditWidgetTest
::
shouldHaveDefaultValue
()
void
VacationEditWidgetTest
::
shouldHaveDefaultValue
()
{
{
KSieveUi
::
VacationEditWidget
w
;
KSieveUi
::
VacationEditWidget
w
;
QLabel
*
configureVacationLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"configureVacationLabel"
));
QLabel
*
configureVacationLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"configureVacationLabel"
));
QVERIFY
(
configureVacationLabel
);
QVERIFY
(
configureVacationLabel
);
...
@@ -141,4 +140,88 @@ void VacationEditWidgetTest::shouldHaveDefaultValue()
...
@@ -141,4 +140,88 @@ void VacationEditWidgetTest::shouldHaveDefaultValue()
QVERIFY
(
mDomainEdit
->
isClearButtonEnabled
());
QVERIFY
(
mDomainEdit
->
isClearButtonEnabled
());
}
}
void
VacationEditWidgetTest
::
shouldGetValues
()
{
KSieveUi
::
VacationEditWidget
w
;
QCheckBox
*
mActiveCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mActiveCheck"
));
KPIMTextEdit
::
PlainTextEditorWidget
*
mTextEdit
=
w
.
findChild
<
KPIMTextEdit
::
PlainTextEditorWidget
*>
(
QStringLiteral
(
"mTextEdit"
));
QLineEdit
*
mSubject
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mSubject"
));
KDateComboBox
*
mStartDate
=
w
.
findChild
<
KDateComboBox
*>
(
QStringLiteral
(
"mStartDate"
));
QCheckBox
*
mStartTimeActive
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mStartTimeActive"
));
KDateComboBox
*
mEndDate
=
w
.
findChild
<
KDateComboBox
*>
(
QStringLiteral
(
"mEndDate"
));
KTimeComboBox
*
mEndTime
=
w
.
findChild
<
KTimeComboBox
*>
(
QStringLiteral
(
"mEndTime"
));
QCheckBox
*
mEndTimeActive
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mEndTimeActive"
));
QSpinBox
*
mIntervalSpin
=
w
.
findChild
<
QSpinBox
*>
(
QStringLiteral
(
"mIntervalSpin"
));
QLineEdit
*
mMailAliasesEdit
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mMailAliasesEdit"
));
QComboBox
*
mMailAction
=
w
.
findChild
<
QComboBox
*>
(
QStringLiteral
(
"mMailAction"
));
QLineEdit
*
mMailActionRecipient
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mMailActionRecipient"
));
QCheckBox
*
mSpamCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mSpamCheck"
));
QCheckBox
*
mDomainCheck
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"mDomainCheck"
));
QLineEdit
*
mDomainEdit
=
w
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"mDomainEdit"
));
bool
activateVacation
=
true
;
w
.
setActivateVacation
(
activateVacation
);
QCOMPARE
(
w
.
activateVacation
(),
activateVacation
);
bool
domainChecked
=
true
;
w
.
setDomainCheck
(
domainChecked
);
QCOMPARE
(
w
.
domainCheck
(),
domainChecked
);
const
QString
message
=
QStringLiteral
(
"foo bla"
);
w
.
setMessageText
(
message
);
QCOMPARE
(
w
.
messageText
(),
message
);
const
QString
subject
=
QStringLiteral
(
"dd"
);
w
.
setSubject
(
subject
);
QCOMPARE
(
w
.
subject
(),
subject
);
const
QString
domain
=
QStringLiteral
(
"ss"
);
w
.
setDomainName
(
domain
);
QCOMPARE
(
w
.
domainName
(),
domain
);
const
int
notify
=
8
;
w
.
setNotificationInterval
(
notify
);
QCOMPARE
(
w
.
notificationInterval
(),
notify
);
#if 0
KMime::Types::AddrSpecList mailAliases() const;
void setMailAliases(const KMime::Types::AddrSpecList &aliases);
void setMailAliases(const QString &aliases);
bool sendForSpam() const;
void setSendForSpam(bool enable);
QDate startDate() const;
void setStartDate(const QDate &startDate);
QTime startTime() const;
void setStartTime(const QTime &startTime);
QDate endDate() const;
void setEndDate(const QDate &endDate);
QTime endTime() const;
void setEndTime(const QTime &endTime);
VacationUtils::MailAction mailAction() const;
QString mailActionRecipient() const;
void setMailAction(VacationUtils::MailAction action, const QString &recipient);
#endif
}
QTEST_MAIN
(
VacationEditWidgetTest
)
QTEST_MAIN
(
VacationEditWidgetTest
)
src/ksieveui/vacation/autotests/vacationeditwidgettest.h
View file @
60d0f1a4
...
@@ -31,6 +31,7 @@ public:
...
@@ -31,6 +31,7 @@ public:
~
VacationEditWidgetTest
();
~
VacationEditWidgetTest
();
private
Q_SLOTS
:
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
void
shouldHaveDefaultValue
();
void
shouldGetValues
();
};
};
#endif // VACATIONEDITWIDGETTEST_H
#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