on xenial help sign in
First easy scopes overview test
f890a7eAlbert Astals
qml/Dash/Dash.qml+2
@@ -71,6 +71,7 @@ Showable {
71
71
72 QtObject {
72 QtObject {
73 id: overviewController
73 id: overviewController
74+ objectName: "overviewController"
74
75
75 property alias enableAnimation: progressAnimation.enabled
76 property alias enableAnimation: progressAnimation.enabled
76 property real progress: 0
77 property real progress: 0
@@ -82,6 +83,7 @@ Showable {
82
83
83 ScopesOverview {
84 ScopesOverview {
84 id: scopesOverview
85 id: scopesOverview
86+ objectName: "scopesOverview"
85 anchors.fill: parent
87 anchors.fill: parent
86 scope: scopes.overviewScope
88 scope: scopes.overviewScope
87 progress: overviewController.progress
89 progress: overviewController.progress
qml/Dash/ScopesOverviewFavorites.qml+1
@@ -43,6 +43,7 @@ Flickable {
43
43
44 Repeater {
44 Repeater {
45 id: repeater
45 id: repeater
46+ objectName: "scopesOverviewFavoritesRepeater"
46
47
47 delegate: Loader {
48 delegate: Loader {
48 id: loader
49 id: loader
tests/qmltests/Dash/tst_Dash.qml+31
@@ -91,5 +91,36 @@ Item {
91 verify(dashContentList != undefined);
91 verify(dashContentList != undefined);
92 tryCompare(dashContentList, "currentIndex", data.visualIndex);
92 tryCompare(dashContentList, "currentIndex", data.visualIndex);
93 }
93 }
94+
95+ function test_dash_overview_show_select_same_favorite() {
96+ // Wait for stuff to be loaded
97+ tryCompare(scopes, "loaded", true);
98+ var dashContentList = findChild(dash, "dashContentList");
99+ tryCompare(dashContentList, "count", 6);
100+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
101+ tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
102+
103+ // Show the overview
104+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
105+ var overviewController = findInvisibleChild(dash, "overviewController");
106+ tryCompare(overviewController, "progress", 1);
107+
108+ // Make sure tab is where it should
109+ var scopesOverview = findChild(dash, "scopesOverview");
110+ compare(scopesOverview.currentTab, 0);
111+
112+ // Make sure stuff is loaded
113+ var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
114+ tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
115+ tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
116+ waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item);
117+
118+ // Click in first item
119+ mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0);
120+
121+ // Make sure animation went back
122+ tryCompare(overviewController, "progress", 0);
123+ compare(dashContentList.currentIndex, 0);
124+ }
94 }
125 }
95}
126}