Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM IncidenceEditor
Commits
83e04fe0
Commit
83e04fe0
authored
Mar 21, 2022
by
Glen Ditchfield
🐛
Browse files
Test start/end validation with timezones
parent
b14b742a
Pipeline
#153024
passed with stage
in 1 minute and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/incidencedatetimetest.cpp
View file @
83e04fe0
...
...
@@ -76,6 +76,14 @@ private Q_SLOTS:
endTime
->
setCurrentText
(
QStringLiteral
(
"12:00:00"
));
QVERIFY
(
editor
->
isValid
());
auto
startZone
=
dialog
->
findChild
<
KTimeZoneComboBox
*>
(
QStringLiteral
(
"mTimeZoneComboStart"
));
QVERIFY2
(
startZone
,
"Couldn't find start time zone field."
);
auto
endZone
=
dialog
->
findChild
<
KTimeZoneComboBox
*>
(
QStringLiteral
(
"mTimeZoneComboEnd"
));
QVERIFY2
(
endZone
,
"Couldn't find end time zone field."
);
startZone
->
selectTimeZone
(
QTimeZone
(
"Africa/Abidjan"
));
// UTC.
endZone
->
selectTimeZone
(
QTimeZone
(
"Africa/Abidjan"
));
QVERIFY
(
editor
->
isValid
());
endDate
->
setDate
(
startDate
->
date
().
addDays
(
-
1
));
endTime
->
setTime
(
startTime
->
time
());
QVERIFY2
(
!
editor
->
isValid
(),
"Didn't detect end date < start date"
);
...
...
@@ -85,6 +93,8 @@ private Q_SLOTS:
QVERIFY2
(
!
editor
->
isValid
(),
"Didn't detect end time < start time"
);
endTime
->
setTime
(
startTime
->
time
());
QVERIFY
(
editor
->
isValid
());
endZone
->
selectTimeZone
(
QTimeZone
(
"Africa/Addis_Ababa"
));
// UTC+3; causes 3-hour shift in effective end time.
QVERIFY2
(
!
editor
->
isValid
(),
"Didn't detect end time < start time in different time zone"
);
QLocale
::
setDefault
(
currentLocale
);
}
...
...
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