@@ -18,6 +18,7 @@ import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Dash"
2020import Ubuntu.Components 1.3
21+import Unity 0.2 // Access the Filters enum
2122import Unity.Test 0.1 as UT
2223
2324Item {
@@ -57,7 +58,7 @@ Item {
5758 tryCompare(dashContentList, "count", 0);
5859 scopes.load();
5960 tryCompare(dashContentList, "currentIndex", 0);
60− tryCompare(dashContentList, "count", 6);
61+ tryCompare(dashContentList, "count", 7);
6162 tryCompare(scopes, "loaded", true);
6263 tryCompareFunction(function() {
6364 var mockScope1Loader = findChild(dash, "scopeLoader0");
@@ -106,6 +107,44 @@ Item {
106107 mouseClick(tile);
107108 }
108109
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")
115+
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)
120+
121+ // Open the primaryNavigationFilter
122+ dashContent.currentScope.setHasNavigation(false)
123+ mouseClick(searchButton)
124+ tryCompare(extraPanel, "visible", true)
125+
126+ var primaryFilterContainer = findChild(extraPanel, "primaryFilterContainer")
127+ verify(primaryFilterContainer)
128+
129+ var primaryFilter = findChild(extraPanel, "primaryFilter")
130+ verify(primaryFilter)
131+ tryCompare(primaryFilter, "widgetType", Filters.OptionSelectorFilter)
132+
133+ var genericScopeView = dashContentList.currentItem;
134+ var categoryListView = findChild(genericScopeView, "categoryListView")
135+ verify(categoryListView)
136+ tryCompare(categoryListView, "atYBeginning", true)
137+
138+ var expandingItem = findChild(primaryFilter, "expandingItem")
139+ verify(expandingItem)
140+ expandingItem.expanded = true
141+
142+ wait(250) // FIXME: Wait for the expanding animation to complete
143+ flickToYEnd(primaryFilterContainer)
144+
145+ tryCompare(categoryListView, "atYBeginning", true)
146+ }
147+
109148 function test_manage_dash_clickscope_unfavoritable() {
110149 // Show the manage dash
111150 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));