on xenial help sign in
test click scope is not favoritable
commit97ca86be0be5dd692c71bb0efa3010567491cc60 authorAlbert Astals <albert.astals@canonical.com> dateFri 12 Dec 2014, 10:49 (12 years ago) parent9aab1d7
3 files changed+27−2
qml/Dash/ScopesListCategory.qml+1−1 qml/Dash/ScopesListCategoryItem.qml+2−1 tests/qmltests/Dash/tst_Dash.qml+24
qml/Dash/ScopesListCategory.qml+1−1
@@ -78,7 +78,7 @@ Item {
7878 clip: height < listItemHeight
7979 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
8080 sourceComponent: ScopesListCategoryItem {
81− objectName: "delegate" + index
81+ objectName: "delegate" + model.scopeId
8282
8383 width: root.width
8484 topMargin: height > listItemHeight ? height - listItemHeight : 0
qml/Dash/ScopesListCategoryItem.qml+2−1
@@ -84,18 +84,19 @@ MouseArea {
8484 }
8585 MouseArea {
8686 id: starArea
87+ objectName: "starArea"
8788 height: parent.height
8889 width: height
8990 anchors.right: parent.right
9091 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
9192 onPressed: if (editMode) root.handlePressed(starArea);
9293 onReleased: if (editMode) root.handleReleased(starArea);
94+ visible: !hideChildren && (editMode || showStar)
9395 Icon {
9496 id: star
9597 anchors.centerIn: parent
9698 height: units.gu(2)
9799 width: units.gu(2)
98− visible: !hideChildren && (editMode || showStar)
99100 // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
100101 source: editMode ? "image://theme/view-grid-symbolic" : isFavorite ? "image://theme/starred" : "image://theme/non-starred"
101102 }
tests/qmltests/Dash/tst_Dash.qml+24
@@ -83,6 +83,30 @@ Item {
8383 return get_scope_data()
8484 }
8585
86+ function test_manage_dash_clickscope_unfavoritable() {
87+ // Show the manage dash
88+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
89+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
90+ tryCompare(bottomEdgeController, "progress", 1);
91+
92+ // Make sure stuff is loaded
93+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
94+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
95+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
96+
97+ // Click scope star area is not visible (i.e. can't be unfavorited)
98+ var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
99+ var starArea = findChild(clickScope, "starArea");
100+ compare(starArea.visible, false);
101+
102+ // Go back
103+ var scopesList = findChild(dash, "scopesList");
104+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
105+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
106+ mouseClick(backButton, 0, 0);
107+ tryCompare(bottomEdgeController, "progress", 0);
108+ }
109+
86110 function test_manage_dash_select_same_favorite() {
87111 // Show the manage dash
88112 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));