@@ -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() {
@@ -105,8 +105,6 @@ Item {
105105 }
106106
107107 function test_filter_expand_collapse() {
108− // wait for the item to be there
109− waitForRendering(genericScopeView);
110108 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
111109
112110 var header = findChild(genericScopeView, "dashSectionHeader0")
@@ -114,18 +112,18 @@ Item {
114112
115113 waitForRendering(header);
116114 verify(category.expandable);
117− verify(category.filtered);
115+ verify(!category.expanded);
118116
119117 var initialHeight = category.height;
120118 var middleHeight;
121119 mouseClick(header, header.width / 2, header.height / 2);
122120 tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
123− tryCompare(category, "filtered", false);
121+ tryCompare(category, "expanded", true);
124122 tryCompareFunction(function() { return category.height > middleHeight; }, true);
125123
126124 mouseClick(header, header.width / 2, header.height / 2);
127125 verify(category.expandable);
128− tryCompare(category, "filtered", true);
126+ tryCompare(category, "expanded", false);
129127 }
130128
131129 function test_filter_expand_expand_collapse() {
@@ -137,51 +135,75 @@ Item {
137135
138136 var header2 = findChild(genericScopeView, "dashSectionHeader2")
139137 var category2 = findChild(genericScopeView, "dashCategory2")
140− var category2FilterGrid = category2.children[1].children[2];
141− verify(UT.Util.isInstanceOf(category2FilterGrid, "CardFilterGrid"));
142138
143139 waitForRendering(header2);
144140 verify(category2.expandable);
145− verify(category2.filtered);
141+ verify(!category2.expanded);
146142
147143 mouseClick(header2, header2.width / 2, header2.height / 2);
148− tryCompare(category2, "filtered", false);
149− tryCompare(category2FilterGrid, "filtered", false);
144+ tryCompare(category2, "expanded", true);
150145
151146 categoryListView.positionAtBeginning();
152147
153148 var header0 = findChild(genericScopeView, "dashSectionHeader0")
154149 var category0 = findChild(genericScopeView, "dashCategory0")
155150 mouseClick(header0, header0.width / 2, header0.height / 2);
156− tryCompare(category0, "filtered", false);
157− tryCompare(category2, "filtered", true);
158− tryCompare(category2FilterGrid, "filtered", true);
151+ tryCompare(category0, "expanded", true);
152+ tryCompare(category2, "expanded", false);
159153 mouseClick(header0, header0.width / 2, header0.height / 2);
160− tryCompare(category0, "filtered", true);
161− tryCompare(category2, "filtered", true);
154+ tryCompare(category0, "expanded", false);
155+ tryCompare(category2, "expanded", false);
162156 }
163157
164158 function test_narrow_delegate_ranges_expand() {
165− tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
159+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") !== null; }, true);
166160 var category = findChild(genericScopeView, "dashCategory0")
167− tryCompare(category, "filtered", true);
161+ tryCompare(category, "expanded", false);
168162
169163 shell.width = units.gu(20)
170164 var categoryListView = findChild(genericScopeView, "categoryListView");
171165 categoryListView.contentY = units.gu(20);
172166 var header0 = findChild(genericScopeView, "dashSectionHeader0")
173167 mouseClick(header0, header0.width / 2, header0.height / 2);
174− tryCompare(category, "filtered", false);
168+ tryCompare(category, "expanded", true);
175169 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
176170 mouseClick(header0, header0.width / 2, header0.height / 2);
177− tryCompare(category, "filtered", true);
171+ tryCompare(category, "expanded", false);
172+ }
173+
174+ function test_forced_category_expansion() {
175+ tryCompareFunction(function() {
176+ mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
177+ genericScopeView.width/2, genericScopeView.y)
178+ return findChild(genericScopeView, "dashCategory19") !== null;
179+ }, true);
180+ var category = findChild(genericScopeView, "dashCategory19")
181+ compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
182+
183+ var grid = findChild(category, "19");
184+ verify(grid, "Could not find the category renderer.");
185+
186+ compare(grid.height, grid.expandedHeight, "Category with collapsed-rows: 0 should always be expanded.");
187+ }
188+
189+ function test_single_category_expansion() {
190+ genericScopeView.scope = scopes.getScope(4);
191+
192+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
193+ var category = findChild(genericScopeView, "dashCategory0")
194+ compare(category.expandable, false, "Only category should not be expandable.");
195+
196+ var grid = findChild(category, "0");
197+ verify(grid, "Could not find the category renderer.");
198+
199+ compare(grid.height, grid.expandedHeight, "Only category should always be expanded");
178200 }
179201
180202 function openPreview() {
181203 tryCompareFunction(function() {
182− var filterGrid = findChild(genericScopeView, "0");
183− if (filterGrid != null) {
184− var tile = findChild(filterGrid, "delegate0");
204+ var cardGrid = findChild(genericScopeView, "0");
205+ if (cardGrid != null) {
206+ var tile = findChild(cardGrid, "delegate0");
185207 return tile != null;
186208 }
187209 return false;
@@ -257,7 +279,7 @@ Item {
257279 closePreview();
258280 }
259281
260− function test_haeder_logo() {
282+ function test_header_logo() {
261283 genericScopeView.scope = scopes.getScope(3);
262284
263285 var image = findChild(genericScopeView, "titleImage");