@@ -18,6 +18,7 @@ import QtQuick 2.4
18import QtTest 1.0
18import QtTest 1.0
19import "../../../qml/Dash"
19import "../../../qml/Dash"
20import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
21+import Unity 0.2 // Access the Filters enum
21import Unity.Test 0.1 as UT
22import Unity.Test 0.1 as UT
@@ -57,7 +58,7 @@ Item {
57 tryCompare(dashContentList, "count", 0);
58 tryCompare(dashContentList, "count", 0);
58 scopes.load();
59 scopes.load();
59 tryCompare(dashContentList, "currentIndex", 0);
60 tryCompare(dashContentList, "currentIndex", 0);
60− tryCompare(dashContentList, "count", 6);
61+ tryCompare(dashContentList, "count", 7);
61 tryCompare(scopes, "loaded", true);
62 tryCompare(scopes, "loaded", true);
62 tryCompareFunction(function() {
63 tryCompareFunction(function() {
63 var mockScope1Loader = findChild(dash, "scopeLoader0");
64 var mockScope1Loader = findChild(dash, "scopeLoader0");
@@ -106,6 +107,44 @@ Item {
106 mouseClick(tile);
107 mouseClick(tile);
110+ function test_longNavigationFilterList() {
111+ // Select the scope with long navigation
112+ dash.setCurrentScope("LongPrimaryNavigation")
113+ var dashContent = findChild(dash, "dashContent")
114+ tryCompare(dashContent.currentScope, "id", "LongPrimaryNavigation")
116+ var dashContentList = findChild(dashContent, "dashContentList")
117+ var searchButton = findChild(dashContentList.currentItem, "search_button")
118+ var extraPanel = findChild(dashContentList.currentItem, "peExtraPanel")
119+ tryCompare(extraPanel, "visible", false)
121+ // Open the primaryNavigationFilter
122+ dashContent.currentScope.setHasNavigation(false)
123+ mouseClick(searchButton)
124+ tryCompare(extraPanel, "visible", true)
126+ var primaryFilterContainer = findChild(extraPanel, "primaryFilterContainer")
127+ verify(primaryFilterContainer)
129+ var primaryFilter = findChild(extraPanel, "primaryFilter")
130+ verify(primaryFilter)
131+ tryCompare(primaryFilter, "widgetType", Filters.OptionSelectorFilter)
133+ var genericScopeView = dashContentList.currentItem;
134+ var categoryListView = findChild(genericScopeView, "categoryListView")
135+ verify(categoryListView)
136+ tryCompare(categoryListView, "atYBeginning", true)
138+ var expandingItem = findChild(primaryFilter, "expandingItem")
139+ verify(expandingItem)
140+ expandingItem.expanded = true
142+ wait(250) // FIXME: Wait for the expanding animation to complete
143+ flickToYEnd(primaryFilterContainer)
145+ tryCompare(categoryListView, "atYBeginning", true)
109 function test_manage_dash_clickscope_unfavoritable() {
148 function test_manage_dash_clickscope_unfavoritable() {
110 // Show the manage dash
149 // Show the manage dash
111 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
150 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));