@@ -70,19 +70,6 @@ Item {
7070 waitForRendering(findChild(dash, "scopeLoader0").item);
7171 }
7272
73− function get_scope_data() {
74− return [
75− { tag: "MockScope1", visualIndex: 0 },
76− { tag: "MockScope2", visualIndex: -1 },
77− { tag: "clickscope", visualIndex: 1 },
78− { tag: "MockScope5", visualIndex: 2 },
79− ]
80− }
81−
82− function test_show_scope_on_load_data() {
83− return get_scope_data()
84− }
85−
8673 function test_manage_dash_clickscope_unfavoritable() {
8774 // Show the manage dash
8875 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
@@ -330,7 +317,7 @@ Item {
330317 spy.target = scopesList.scope;
331318 spy.signalName = "performQuery";
332319
333− // Do a search
320+ // Click on the store
334321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
335322 var searchButton = findChild(scopesListPageHeader, "store_header_button");
336323 mouseClick(searchButton, 0, 0);
@@ -339,5 +326,47 @@ Item {
339326 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
340327 tryCompare(bottomEdgeController, "progress", 0);
341328 }
329+
330+ function test_manage_dash_move_current() {
331+ var dashContentList = findChild(dash, "dashContentList");
332+ compare(dashContentList.currentIndex, 0);
333+ compare(dashContentList.currentItem.scopeId, "MockScope1");
334+
335+ // Show the manage dash
336+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
337+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
338+ tryCompare(bottomEdgeController, "progress", 1);
339+
340+ // Make sure stuff is loaded
341+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
342+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
343+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
344+
345+ // Enter edit mode
346+ var scopesList = findChild(dash, "scopesList");
347+ var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
348+ mousePress(clickScope, 0, 0);
349+ tryCompare(scopesList, "state", "edit");
350+ mouseRelease(clickScope, 0, 0);
351+
352+ var starArea = findChild(clickScope, "starArea");
353+ touchFlick(starArea, 0, 0, 0, -units.gu(10));
354+
355+ // Exit edit mode and go back
356+ var scopesList = findChild(dash, "scopesList");
357+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
358+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
359+ mouseClick(backButton, 0, 0);
360+ mouseClick(backButton, 0, 0);
361+ tryCompare(bottomEdgeController, "progress", 0);
362+
363+ tryCompare(dashContentList, "currentIndex", 0);
364+ compare(dashContentList.currentItem.scopeId, "clickscope");
365+
366+ // Move to second scope
367+ touchFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
368+ tryCompare(dashContentList, "currentIndex", 1);
369+ compare(dashContentList.currentItem.scopeId, "MockScope1");
370+ }
342371 }
343372}