on xenial help sign in
Another simple test
commit5d6ee650a7e41089ebf7b8f4ec7fa0c8bc68f16b authorAlbert Astals <albert.astals@canonical.com> dateFri 18 Jul 2014, 17:43 (12 years ago) parentf890a7e
1 file changed+31
tests/qmltests/Dash/tst_Dash.qml+31
tests/qmltests/Dash/tst_Dash.qml+31
@@ -122,5 +122,36 @@ Item {
122122 tryCompare(overviewController, "progress", 0);
123123 compare(dashContentList.currentIndex, 0);
124124 }
125+
126+ function test_dash_overview_show_select_different_favorite() {
127+ // Wait for stuff to be loaded
128+ tryCompare(scopes, "loaded", true);
129+ var dashContentList = findChild(dash, "dashContentList");
130+ tryCompare(dashContentList, "count", 6);
131+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
132+ tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
133+
134+ // Show the overview
135+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
136+ var overviewController = findInvisibleChild(dash, "overviewController");
137+ tryCompare(overviewController, "progress", 1);
138+
139+ // Make sure tab is where it should
140+ var scopesOverview = findChild(dash, "scopesOverview");
141+ compare(scopesOverview.currentTab, 0);
142+
143+ // Make sure stuff is loaded
144+ var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
145+ tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
146+ tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
147+ waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
148+
149+ // Click in first item
150+ mouseClick(scopesOverviewFavoritesRepeater.itemAt(1).item, 0, 0);
151+
152+ // Make sure animation went back
153+ tryCompare(overviewController, "progress", 0);
154+ compare(dashContentList.currentIndex, 1);
155+ }
125156 }
126157}