on xenial help sign in
WIP
commit52195ca7a7942333bb017740fdb1d1b01dbc8824 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 16 Jan 2015, 14:40 (12 years ago) parent202e068
3 files changed+60−4
qml/Dash/Dash.qml+2−2 qml/Dash/DashContent.qml+1−2 tests/qmltests/Dash/tst_Dash.qml+57
qml/Dash/Dash.qml+2−2
@@ -199,8 +199,7 @@ Showable {
199199 }
200200 }
201201
202− DashBackground
203− {
202+ DashBackground{
204203 anchors.fill: scopeItem
205204 visible: scopeItem.visible
206205 }
@@ -229,6 +228,7 @@ Showable {
229228 dashContent.gotoScope(scopeId);
230229 }
231230 onOpenScope: {
231+ scopeItem.closePreview();
232232 dashContent.openScope(scope);
233233 }
234234 }
qml/Dash/DashContent.qml+1−2
@@ -84,8 +84,7 @@ Item {
8484
8585 set_current_index = undefined;
8686
87− if (dashContentList.count > index)
88− {
87+ if (dashContentList.count > index) {
8988 dashContentList.currentIndex = index
9089
9190 if (reset) {
tests/qmltests/Dash/tst_Dash.qml+57
@@ -428,5 +428,62 @@ Item {
428428 tryCompare(bottomEdgeController, "progress", 0);
429429 tryCompare(dashContentList, "currentIndex", 1)
430430 }
431+
432+ function test_close_temp_scope_preview_opening_scope() {
433+ // Show the manage dash
434+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
435+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
436+ tryCompare(bottomEdgeController, "progress", 1);
437+
438+ // Make sure stuff is loaded
439+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
440+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
441+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
442+
443+ // Click on a non favorite scope
444+ mouseClick(nonfavScopesListCategoryList.currentItem);
445+
446+ // Check the bottom edge (manage dash) is disabled from temp scope
447+ var overviewDragHandle = findChild(dash, "overviewDragHandle");
448+ compare(overviewDragHandle.enabled, false);
449+
450+ // Check temp scope is there
451+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
452+ tryCompare(dashTempScopeItem, "x", 0);
453+ tryCompare(dashTempScopeItem, "visible", true);
454+
455+ // Check the manage dash is gone
456+ tryCompare(bottomEdgeController, "progress", 0);
457+
458+ // Open preview
459+ var categoryListView = findChild(dashTempScopeItem, "categoryListView");
460+ categoryListView.positionAtBeginning();
461+ tryCompareFunction(function() {
462+ var cardGrid = findChild(dashTempScopeItem, "dashCategory0");
463+ if (cardGrid != null) {
464+ var tile = findChild(cardGrid, "delegate0");
465+ return tile != null;
466+ }
467+ return false;
468+ },
469+ true);
470+ var tile = findChild(findChild(dashTempScopeItem, "dashCategory0"), "delegate0");
471+ waitForRendering(tile);
472+ mouseClick(tile);
473+ var subPageLoader = findChild(dashTempScopeItem, "subPageLoader");
474+ tryCompare(subPageLoader, "open", true);
475+ tryCompare(subPageLoader, "x", 0);
476+ tryCompare(findChild(dashTempScopeItem, "categoryListView"), "visible", false);
477+
478+ dashTempScopeItem.scope.openScope(scopes.getScopeFromAll("MockScope7"));
479+ tryCompare(subPageLoader, "open", false);
480+
481+ // Go back
482+ dashTempScopeItem.backClicked();
483+
484+ // Check temp scope is gone
485+ tryCompare(dashTempScopeItem, "x", dash.width);
486+ tryCompare(dashTempScopeItem, "visible", false);
487+ }
431488 }
432489}