@@ -19,6 +19,7 @@ import QtTest 1.0
19import Unity 0.1
19import Unity 0.1
20import ".."
20import ".."
21import "../../../Dash"
21import "../../../Dash"
22+import "../../../Components"
22import Ubuntu.Components 0.1
23import Ubuntu.Components 0.1
23import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
@@ -43,6 +44,7 @@ Item {
43 GenericScopeView {
44 GenericScopeView {
44 id: genericScopeView
45 id: genericScopeView
45 anchors.fill: parent
46 anchors.fill: parent
47+ searchHistory: SearchHistoryModel {}
47 UT.UnityTestCase {
49 UT.UnityTestCase {
48 name: "GenericScopeView"
50 name: "GenericScopeView"
@@ -223,6 +225,29 @@ Item {
223 tryCompare(genericScopeView.scope, "searchQuery", "")
225 tryCompare(genericScopeView.scope, "searchQuery", "")
228+ function test_filter_expand_collapse() {
229+ // wait for the item to be there
230+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != undefined; }, true);
232+ var header = findChild(genericScopeView, "dashSectionHeader0")
233+ var category = findChild(genericScopeView, "dashCategory0")
235+ waitForRendering(header);
236+ verify(category.expandable);
237+ verify(category.filtered);
239+ var initialHeight = category.height;
241+ mouseClick(header, header.width / 2, header.height / 2);
242+ tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
243+ tryCompare(category, "filtered", false);
244+ verify(category.height > middleHeight);
246+ mouseClick(header, header.width / 2, header.height / 2);
247+ verify(category.expandable);
248+ tryCompare(category, "filtered", true);
226 function test_showPreviewCarousel() {
251 function test_showPreviewCarousel() {
227 tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
252 tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
228 var tile = findChild(genericScopeView, "carouselDelegate");
253 var tile = findChild(genericScopeView, "carouselDelegate");