@@ -59,7 +59,7 @@ Item {
5959 genericScopeView.scope = scopes.getScope(1)
6060 shell.width = units.gu(120)
6161 genericScopeView.categoryView.positionAtBeginning();
62− tryCompare(genericScopeView.categoryView, "contentY", 0)
62+ waitForRendering(genericScopeView.categoryView);
6363 }
6464
6565 function test_isActive() {
@@ -104,84 +104,103 @@ Item {
104104 tryCompare(genericScopeView.scope, "searchQuery", "test")
105105 }
106106
107− function test_filter_expand_collapse() {
108− // wait for the item to be there
109− waitForRendering(genericScopeView);
107+ function test_expand_collapse() {
110108 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
111109
112− var header = findChild(genericScopeView, "dashSectionHeader0")
113110 var category = findChild(genericScopeView, "dashCategory0")
111+ var seeAll = findChild(category, "seeAll")
114112
115− waitForRendering(header);
113+ waitForRendering(seeAll);
116114 verify(category.expandable);
117− verify(category.filtered);
115+ verify(!category.expanded);
118116
119117 var initialHeight = category.height;
120− var middleHeight;
121− mouseClick(header, header.width / 2, header.height / 2);
122− tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
123− tryCompare(category, "filtered", false);
124− tryCompareFunction(function() { return category.height > middleHeight; }, true);
118+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
119+ verify(category.expanded);
120+ tryCompareFunction(function() { return category.height > initialHeight; }, true);
125121
126− mouseClick(header, header.width / 2, header.height / 2);
127− verify(category.expandable);
128− tryCompare(category, "filtered", true);
122+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
123+ verify(!category.expanded);
129124 }
130125
131− function test_filter_expand_expand_collapse() {
126+ function test_expand_expand_collapse() {
132127 // wait for the item to be there
133128 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != null; }, true);
134129
135130 var categoryListView = findChild(genericScopeView, "categoryListView");
136131 categoryListView.contentY = categoryListView.height;
137132
138− var header2 = findChild(genericScopeView, "dashSectionHeader2")
139133 var category2 = findChild(genericScopeView, "dashCategory2")
140− var category2FilterGrid = category2.children[1].children[2];
141− verify(UT.Util.isInstanceOf(category2FilterGrid, "CardFilterGrid"));
134+ var seeAll2 = findChild(category2, "seeAll")
142135
143− waitForRendering(header2);
136+ waitForRendering(seeAll2);
144137 verify(category2.expandable);
145− verify(category2.filtered);
138+ verify(!category2.expanded);
146139
147− mouseClick(header2, header2.width / 2, header2.height / 2);
148− tryCompare(category2, "filtered", false);
149− tryCompare(category2FilterGrid, "filtered", false);
140+ mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
141+ tryCompare(category2, "expanded", true);
150142
151143 categoryListView.positionAtBeginning();
152144
153− var header0 = findChild(genericScopeView, "dashSectionHeader0")
154145 var category0 = findChild(genericScopeView, "dashCategory0")
155− mouseClick(header0, header0.width / 2, header0.height / 2);
156− tryCompare(category0, "filtered", false);
157− tryCompare(category2, "filtered", true);
158− tryCompare(category2FilterGrid, "filtered", true);
159− mouseClick(header0, header0.width / 2, header0.height / 2);
160− tryCompare(category0, "filtered", true);
161− tryCompare(category2, "filtered", true);
146+ var seeAll0 = findChild(category0, "seeAll")
147+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
148+ tryCompare(category0, "expanded", true);
149+ tryCompare(category2, "expanded", false);
150+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
151+ tryCompare(category0, "expanded", false);
152+ tryCompare(category2, "expanded", false);
162153 }
163154
164155 function test_narrow_delegate_ranges_expand() {
165− tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
156+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") !== null; }, true);
166157 var category = findChild(genericScopeView, "dashCategory0")
167− tryCompare(category, "filtered", true);
158+ tryCompare(category, "expanded", false);
168159
169160 shell.width = units.gu(20)
170161 var categoryListView = findChild(genericScopeView, "categoryListView");
171162 categoryListView.contentY = units.gu(20);
172− var header0 = findChild(genericScopeView, "dashSectionHeader0")
173− mouseClick(header0, header0.width / 2, header0.height / 2);
174− tryCompare(category, "filtered", false);
163+ var seeAll = findChild(category, "seeAll")
164+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
165+ tryCompare(category, "expanded", true);
175166 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
176− mouseClick(header0, header0.width / 2, header0.height / 2);
177− tryCompare(category, "filtered", true);
167+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
168+ tryCompare(category, "expanded", false);
169+ }
170+
171+ function test_forced_category_expansion() {
172+ tryCompareFunction(function() {
173+ mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
174+ genericScopeView.width/2, genericScopeView.y)
175+ return findChild(genericScopeView, "dashCategory19") !== null;
176+ }, true);
177+ var category = findChild(genericScopeView, "dashCategory19")
178+ compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
179+
180+ var grid = findChild(category, "19");
181+ verify(grid, "Could not find the category renderer.");
182+
183+ compare(grid.height, grid.expandedHeight, "Category with collapsed-rows: 0 should always be expanded.");
184+ }
185+
186+ function test_single_category_expansion() {
187+ genericScopeView.scope = scopes.getScope(4);
188+
189+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
190+ var category = findChild(genericScopeView, "dashCategory0")
191+ compare(category.expandable, false, "Only category should not be expandable.");
192+
193+ var grid = findChild(category, "0");
194+ verify(grid, "Could not find the category renderer.");
195+
196+ compare(grid.height, grid.expandedHeight, "Only category should always be expanded");
178197 }
179198
180199 function openPreview() {
181200 tryCompareFunction(function() {
182− var filterGrid = findChild(genericScopeView, "0");
183− if (filterGrid != null) {
184− var tile = findChild(filterGrid, "delegate0");
201+ var cardGrid = findChild(genericScopeView, "0");
202+ if (cardGrid != null) {
203+ var tile = findChild(cardGrid, "delegate0");
185204 return tile != null;
186205 }
187206 return false;
@@ -257,7 +276,7 @@ Item {
257276 closePreview();
258277 }
259278
260− function test_haeder_logo() {
279+ function test_header_logo() {
261280 genericScopeView.scope = scopes.getScope(3);
262281
263282 var image = findChild(genericScopeView, "titleImage");