@@ -60,7 +60,7 @@ Item {
6060 genericScopeView.scope = scopes.getScope(1)
6161 shell.width = units.gu(120)
6262 genericScopeView.categoryView.positionAtBeginning();
63− tryCompare(genericScopeView.categoryView, "contentY", 0)
63+ waitForRendering(genericScopeView.categoryView);
6464 }
6565
6666 function test_isActive() {
@@ -106,8 +106,6 @@ Item {
106106 }
107107
108108 function test_filter_expand_collapse() {
109− // wait for the item to be there
110− waitForRendering(genericScopeView);
111109 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
112110
113111 var header = findChild(genericScopeView, "dashSectionHeader0")
@@ -115,18 +113,18 @@ Item {
115113
116114 waitForRendering(header);
117115 verify(category.expandable);
118− verify(category.filtered);
116+ verify(!category.expanded);
119117
120118 var initialHeight = category.height;
121119 var middleHeight;
122120 mouseClick(header, header.width / 2, header.height / 2);
123121 tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
124− tryCompare(category, "filtered", false);
122+ tryCompare(category, "expanded", true);
125123 tryCompareFunction(function() { return category.height > middleHeight; }, true);
126124
127125 mouseClick(header, header.width / 2, header.height / 2);
128126 verify(category.expandable);
129− tryCompare(category, "filtered", true);
127+ tryCompare(category, "expanded", false);
130128 }
131129
132130 function test_filter_expand_expand_collapse() {
@@ -138,51 +136,75 @@ Item {
138136
139137 var header2 = findChild(genericScopeView, "dashSectionHeader2")
140138 var category2 = findChild(genericScopeView, "dashCategory2")
141− var category2FilterGrid = category2.children[1].children[2];
142− verify(UT.Util.isInstanceOf(category2FilterGrid, "CardFilterGrid"));
143139
144140 waitForRendering(header2);
145141 verify(category2.expandable);
146− verify(category2.filtered);
142+ verify(!category2.expanded);
147143
148144 mouseClick(header2, header2.width / 2, header2.height / 2);
149− tryCompare(category2, "filtered", false);
150− tryCompare(category2FilterGrid, "filtered", false);
145+ tryCompare(category2, "expanded", true);
151146
152147 categoryListView.positionAtBeginning();
153148
154149 var header0 = findChild(genericScopeView, "dashSectionHeader0")
155150 var category0 = findChild(genericScopeView, "dashCategory0")
156151 mouseClick(header0, header0.width / 2, header0.height / 2);
157− tryCompare(category0, "filtered", false);
158− tryCompare(category2, "filtered", true);
159− tryCompare(category2FilterGrid, "filtered", true);
152+ tryCompare(category0, "expanded", true);
153+ tryCompare(category2, "expanded", false);
160154 mouseClick(header0, header0.width / 2, header0.height / 2);
161− tryCompare(category0, "filtered", true);
162− tryCompare(category2, "filtered", true);
155+ tryCompare(category0, "expanded", false);
156+ tryCompare(category2, "expanded", false);
163157 }
164158
165159 function test_narrow_delegate_ranges_expand() {
166− tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
160+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") !== null; }, true);
167161 var category = findChild(genericScopeView, "dashCategory0")
168− tryCompare(category, "filtered", true);
162+ tryCompare(category, "expanded", false);
169163
170164 shell.width = units.gu(20)
171165 var categoryListView = findChild(genericScopeView, "categoryListView");
172166 categoryListView.contentY = units.gu(20);
173167 var header0 = findChild(genericScopeView, "dashSectionHeader0")
174168 mouseClick(header0, header0.width / 2, header0.height / 2);
175− tryCompare(category, "filtered", false);
169+ tryCompare(category, "expanded", true);
176170 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
177171 mouseClick(header0, header0.width / 2, header0.height / 2);
178− tryCompare(category, "filtered", true);
172+ tryCompare(category, "expanded", false);
173+ }
174+
175+ function test_forced_category_expansion() {
176+ tryCompareFunction(function() {
177+ mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
178+ genericScopeView.width/2, genericScopeView.y)
179+ return findChild(genericScopeView, "dashCategory19") !== null;
180+ }, true);
181+ var category = findChild(genericScopeView, "dashCategory19")
182+ compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
183+
184+ var grid = findChild(category, "19");
185+ verify(grid, "Could not find the category renderer.");
186+
187+ compare(grid.height, grid.expandedHeight, "Category with collapsed-rows: 0 should always be expanded.");
188+ }
189+
190+ function test_single_category_expansion() {
191+ genericScopeView.scope = scopes.getScope(4);
192+
193+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
194+ var category = findChild(genericScopeView, "dashCategory0")
195+ compare(category.expandable, false, "Only category should not be expandable.");
196+
197+ var grid = findChild(category, "0");
198+ verify(grid, "Could not find the category renderer.");
199+
200+ compare(grid.height, grid.expandedHeight, "Only category should always be expanded");
179201 }
180202
181203 function openPreview() {
182204 tryCompareFunction(function() {
183− var filterGrid = findChild(genericScopeView, "0");
184− if (filterGrid != null) {
185− var tile = findChild(filterGrid, "delegate0");
205+ var cardGrid = findChild(genericScopeView, "0");
206+ if (cardGrid != null) {
207+ var tile = findChild(cardGrid, "delegate0");
186208 return tile != null;
187209 }
188210 return false;