Merge lp:~nick-dedekind/ubuntu-settings-components/calendar-test-fixes into lp:ubuntu-settings-components

Proposed by Nick Dedekind
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 161
Merged at revision: 160
Proposed branch: lp:~nick-dedekind/ubuntu-settings-components/calendar-test-fixes
Merge into: lp:ubuntu-settings-components
Diff against target: 57 lines (+9/-7)
2 files modified
plugins/Ubuntu/Settings/Components/Calendar.qml (+4/-4)
tests/qmltests/Components/tst_Calendar.qml (+5/-3)
To merge this branch: bzr merge lp:~nick-dedekind/ubuntu-settings-components/calendar-test-fixes
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+303113@code.launchpad.net

Commit message

Fixes for calendar test failures.

Description of the change

Fixes for calendar test failures.

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:160
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/49/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2569
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1392
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1392
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1392
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2597
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2477
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2477
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2477
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2471/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2471
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2471/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/49/rebuild

review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) :
161. By Nick Dedekind

removed unnecessary line

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

done.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

done.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good to me :)

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:161
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/53/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2574
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1396
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1396
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1396
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2602
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2482
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2482
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2482
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2476/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2476
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2476/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/53/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Ubuntu/Settings/Components/Calendar.qml'
2--- plugins/Ubuntu/Settings/Components/Calendar.qml 2016-06-27 16:07:11 +0000
3+++ plugins/Ubuntu/Settings/Components/Calendar.qml 2016-08-17 11:17:29 +0000
4@@ -23,7 +23,7 @@
5 id: monthView
6
7 property bool collapsed: false
8- property var currentDate: new Date(priv.today.year, priv.today.month, 1)
9+ property var currentDate: new Date(priv.selectedDay.year, priv.selectedDay.month, 1)
10 property var firstDayOfWeek: Qt.locale(i18n.language).firstDayOfWeek
11 property var maximumDate
12 property var minimumDate
13@@ -88,7 +88,7 @@
14 return month;
15 }
16
17- function __getRealMaximumMonth(date) {
18+ function __getRealMaximumMonth(month) {
19 if (maximumMonth !== undefined && maximumMonth < month) {
20 return maximumMonth;
21 }
22@@ -99,8 +99,8 @@
23 // disable the onCurrentIndexChanged logic
24 priv.ready = false;
25
26- var minimumMonth = __getRealMinimumMonth(currentMonth).addMonths(-2);
27- var maximumMonth = __getRealMinimumMonth(currentMonth).addMonths(2);
28+ var minimumMonth = __getRealMinimumMonth(currentMonth.addMonths(-2));
29+ var maximumMonth = __getRealMaximumMonth(currentMonth.addMonths(2));
30
31 // Remove old minimum months
32 while (calendarModel.count > 0 && new Cal.Month(calendarModel.get(0).month) < minimumMonth) {
33
34=== modified file 'tests/qmltests/Components/tst_Calendar.qml'
35--- tests/qmltests/Components/tst_Calendar.qml 2016-03-30 10:01:07 +0000
36+++ tests/qmltests/Components/tst_Calendar.qml 2016-08-17 11:17:29 +0000
37@@ -78,8 +78,9 @@
38
39 function test_selectedDate(data) {
40 calendar.selectedDate = data.date;
41- compare(calendar.currentItem.monthStart.getYear(), data.date.getYear(), "Current year does no correspond to set date");
42- compare(calendar.currentItem.monthStart.getMonth(), data.date.getMonth(), "Current month does no correspond to set date");
43+
44+ compare(calendar.currentItem.monthStart.year, data.date.getFullYear(), "Current year does no correspond to set date");
45+ compare(calendar.currentItem.monthStart.month, data.date.getMonth(), "Current month does no correspond to set date");
46 }
47
48 function test_firstDayOfWeek_data() {
49@@ -96,7 +97,8 @@
50 var dayColumn = findChild(calendar, "dayItem" + i);
51 verify(dayColumn);
52
53- compare(dayColumn.dayStart.getDay(), (data.firstDayOfWeek + i)%7, "Day column does not match expected for firstDayOfWeek");
54+ var dayStart = new Date(dayColumn.dayStart.year, dayColumn.dayStart.month, dayColumn.dayStart.day);
55+ compare(dayStart.getDay(), (data.firstDayOfWeek + i)%7, "Day column does not match expected for firstDayOfWeek");
56 }
57 }
58

Subscribers

People subscribed via source and target branches

to all changes: