@@ -21,6 +21,7 @@ import MeeGo.QOfono 0.2
21import QMenuModel 0.1
21import QMenuModel 0.1
22import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
23import Ubuntu.SystemSettings.SecurityPrivacy 1.0
23import Ubuntu.SystemSettings.SecurityPrivacy 1.0
24+import Ubuntu.SystemSettings.TimeDate 1.0
24import Unity.Test 0.1 as UT
25import Unity.Test 0.1 as UT
25import Wizard 0.1
26import Wizard 0.1
26import "../../../qml/Wizard"
27import "../../../qml/Wizard"
@@ -68,6 +69,11 @@ Item {
68 signalName: "activated"
69 signalName: "activated"
74+ signalName: "timeZoneChangedCalled"
71 function setup() {
77 function setup() {
72 AccountsService.hereEnabled = false;
78 AccountsService.hereEnabled = false;
73 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
79 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
@@ -81,6 +87,7 @@ Item {
81 setSecuritySpy.clear();
87 setSecuritySpy.clear();
82 activateLocationSpy.clear();
88 activateLocationSpy.clear();
83 activateGPSSpy.clear();
89 activateGPSSpy.clear();
85 ActionData.data = {
92 ActionData.data = {
86 "location-detection-enabled": {
93 "location-detection-enabled": {
@@ -193,7 +200,7 @@ Item {
193 var tzList = findChild(page, "tzList");
200 var tzList = findChild(page, "tzList");
194 verify(tzList);
201 verify(tzList);
195 waitForRendering(tzList);
202 waitForRendering(tzList);
196− tzList.currentIndex = 0; // FIXME make it more generic
203+ tzList.currentIndex = 0;
197 page.selectedTimeZone = "Pacific/Honolulu";
204 page.selectedTimeZone = "Pacific/Honolulu";
198 tap(findChild(page, "forwardButton"));
205 tap(findChild(page, "forwardButton"));
@@ -451,5 +458,30 @@ Item {
451 tryCompare(activateLocationSpy, "count", 1);
458 tryCompare(activateLocationSpy, "count", 1);
452 tryCompare(activateGPSSpy, "count", 1);
459 tryCompare(activateGPSSpy, "count", 1);
462+ function test_timezonePage() {
463+ var page = goToPage("tzPage");
465+ timezoneSpy.target = page.tdModule;
467+ var tzFilter = findChild(page, "tzFilter");
470+ typeString("London");
472+ var tzList = findChild(page, "tzList");
475+ // test filtering works and returns some results
476+ tryCompareFunction(function() { return tzList.count > 0; }, true);
478+ // just tap the first one
479+ tap(findChild(page, "tz0"));
481+ // go next and verify the (mock) signal got fired
482+ tap(findChild(page, "forwardButton"));
483+ tryCompare(timezoneSpy, "count", 1);
484+ tryCompare(page.tdModule, "timeZone", timezoneSpy.signalArguments[0][0]);