@@ -87,19 +87,26 @@ Item {
8787 tryCompare(previewListView, "open", false);
8888 }
8989
90− function openPreview() {
91− var categoryListView = findChild(genericScopeView, "categoryListView");
92− categoryListView.positionAtBeginning();
93−
90+ function openPreview(filterGridName, willOpen) {
91+ if (filterGridName === undefined)
92+ filterGridName = "0";
93+ if (willOpen === undefined)
94+ willOpen = true;
9495 tryCompareFunction(function() {
95− var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
96− return tile != undefined;
96+ var filterGrid = findChild(genericScopeView, filterGridName);
97+ console.log(filterGrid)
98+ if (filterGrid != null) {
99+ var tile = findChild(filterGrid, "delegate0");
100+ return tile != undefined;
101+ }
102+ return false;
97103 },
98104 true);
99− var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
105+ var tile = findChild(findChild(genericScopeView, filterGridName), "delegate0");
106+ console.log(tile, tile.x, tile.y, tile.width, tile.height)
100107 mouseClick(tile, tile.width / 2, tile.height / 2);
101− tryCompare(previewListView, "open", true);
102− tryCompare(openEffect, "gap", 1);
108+ tryCompare(previewListView, "open", willOpen);
109+ tryCompare(openEffect, "gap", willOpen ? 1 : 0);
103110 }
104111
105112 function checkArrowPosition(index) {
@@ -129,6 +136,8 @@ Item {
129136
130137 function test_previewOpenClose() {
131138 tryCompare(previewListView, "open", false);
139+ var categoryListView = findChild(genericScopeView, "categoryListView");
140+ categoryListView.positionAtBeginning();
132141
133142 openPreview();
134143
@@ -168,6 +177,9 @@ Item {
168177 }
169178
170179 function test_previewCycle() {
180+ var categoryListView = findChild(genericScopeView, "categoryListView");
181+ categoryListView.positionAtBeginning();
182+
171183 tryCompare(previewListView, "open", false);
172184 tryCompare(openEffect, "gap", 0);
173185
@@ -222,8 +234,13 @@ Item {
222234 }
223235
224236 function test_show_spinner() {
237+ var categoryListView = findChild(genericScopeView, "categoryListView");
238+ waitForRendering(categoryListView);
239+ categoryListView.contentY = units.gu(13);
225240 openPreview();
226241 var previewLoader = findChild(previewListView, "previewLoader0");
242+ compare(previewLoader.source.toString().split("/").pop(), "DashPreviewPlaceholder.qml");
243+ compare(categoryListView.contentY, 0)
227244 tryCompare(previewLoader, "progress", 1.0);
228245 tryCompareFunction(function() { return previewLoader.item != undefined; }, true);
229246
@@ -295,13 +312,13 @@ Item {
295312
296313 function test_filter_expand_expand() {
297314 // wait for the item to be there
298− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
315+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderinstalled") != undefined; }, true);
299316
300317 var categoryListView = findChild(genericScopeView, "categoryListView");
301318 categoryListView.contentY = categoryListView.height;
302319
303− var header2 = findChild(genericScopeView, "dashSectionHeader2")
304− var category2 = findChild(genericScopeView, "dashCategory2")
320+ var header2 = findChild(genericScopeView, "dashSectionHeaderinstalled")
321+ var category2 = findChild(genericScopeView, "dashCategoryinstalled")
305322 var category2FilterGrid = category2.children[0].children[0].children[0];
306323 verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
307324
@@ -330,6 +347,20 @@ Item {
330347 tryCompare(category2, "filtered", true);
331348 tryCompare(category2FilterGrid, "filter", true);
332349 }
350+
351+ function test_no_move_y_no_preview() {
352+ waitForRendering(genericScopeView);
353+ var categoryListView = findChild(genericScopeView, "categoryListView");
354+ waitForRendering(categoryListView);
355+ var category = findChild(genericScopeView, "dashCategoryinstalled")
356+ categoryListView.contentY = category.y;
357+ waitForRendering(categoryListView);
358+ var contentYBefore = categoryListView.contentY
359+ openPreview("installed", false); // This actually doesn't open anything because we
360+ // have code so that the item of installed
361+ // does activate instead of preview and never shows a preview
362+ compare(categoryListView.contentY, contentYBefore);
363+ }
333364 }
334365 }
335366