@@ -32,7 +32,7 @@ Item {
3232 id: scopes
3333
3434 onLoadedChanged: {
35− genericScopeView.scope = scopes.get(0)
35+ genericScopeView.scope = scopes.get(2)
3636 }
3737 }
3838
@@ -94,37 +94,42 @@ Item {
9494 function test_showDash() {
9595 previewListView.open = true;
9696 tryCompare(openEffect, "live", true);
97− scopes.get(0).showDash();
97+ scopes.get(2).showDash();
9898 tryCompare(previewListView, "open", false);
9999 tryCompare(openEffect, "live", true);
100100 }
101101
102102 function test_hideDash() {
103103 previewListView.open = true;
104− scopes.get(0).hideDash();
104+ scopes.get(2).hideDash();
105105 tryCompare(previewListView, "open", false);
106106 tryCompare(openEffect, "gap", 0);
107107 }
108108
109− function openPreview() {
110− var categoryListView = findChild(genericScopeView, "categoryListView");
111− categoryListView.positionAtBeginning();
112−
109+ function openPreview(filterGridName, willOpen) {
110+ if (filterGridName === undefined)
111+ filterGridName = "0";
112+ if (willOpen === undefined)
113+ willOpen = true;
113114 tryCompareFunction(function() {
114− var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
115− return tile != undefined;
115+ var filterGrid = findChild(genericScopeView, filterGridName);
116+ if (filterGrid != null) {
117+ var tile = findChild(filterGrid, "delegate0");
118+ return tile != null;
119+ }
120+ return false;
116121 },
117122 true);
118− var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
123+ var tile = findChild(findChild(genericScopeView, filterGridName), "delegate0");
119124 mouseClick(tile, tile.width / 2, tile.height / 2);
120− tryCompare(previewListView, "open", true);
121− tryCompare(openEffect, "gap", 1);
125+ tryCompare(previewListView, "open", willOpen);
126+ tryCompare(openEffect, "gap", willOpen ? 1 : 0);
122127 }
123128
124129 function checkArrowPosition(index) {
125130 tryCompareFunction(function() {
126131 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
127− return tile != undefined;
132+ return tile != null;
128133 },
129134 true);
130135 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
@@ -148,6 +153,8 @@ Item {
148153
149154 function test_previewOpenClose() {
150155 tryCompare(previewListView, "open", false);
156+ var categoryListView = findChild(genericScopeView, "categoryListView");
157+ categoryListView.positionAtBeginning();
151158
152159 openPreview();
153160
@@ -187,6 +194,9 @@ Item {
187194 }
188195
189196 function test_previewCycle() {
197+ var categoryListView = findChild(genericScopeView, "categoryListView");
198+ categoryListView.positionAtBeginning();
199+
190200 tryCompare(previewListView, "open", false);
191201 tryCompare(openEffect, "gap", 0);
192202
@@ -241,8 +251,13 @@ Item {
241251 }
242252
243253 function test_show_spinner() {
254+ var categoryListView = findChild(genericScopeView, "categoryListView");
255+ waitForRendering(categoryListView);
256+ categoryListView.contentY = units.gu(13);
244257 openPreview();
245258 var previewLoader = findChild(previewListView, "previewLoader0");
259+ compare(previewLoader.source.toString().split("/").pop(), "DashPreviewPlaceholder.qml");
260+ compare(categoryListView.contentY, 0)
246261 tryCompare(previewLoader, "progress", 1.0);
247262 tryCompareFunction(function() { return previewLoader.item != undefined; }, true);
248263
@@ -258,13 +273,13 @@ Item {
258273 function test_changeScope() {
259274 genericScopeView.scope.searchQuery = "test"
260275 genericScopeView.scope = scopes.get(1)
261− genericScopeView.scope = scopes.get(0)
276+ genericScopeView.scope = scopes.get(2)
262277 tryCompare(genericScopeView.scope, "searchQuery", "")
263278 }
264279
265280 function test_filter_expand_collapse() {
266281 // wait for the item to be there
267− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != undefined; }, true);
282+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
268283
269284 var header = findChild(genericScopeView, "dashSectionHeader0")
270285 var category = findChild(genericScopeView, "dashCategory0")
@@ -301,7 +316,7 @@ Item {
301316 }
302317
303318 function test_showPreviewCarousel() {
304− tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
319+ tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != null; }, true);
305320 var tile = findChild(genericScopeView, "carouselDelegate");
306321 mouseClick(tile, tile.width / 2, tile.height / 2);
307322 tryCompare(openEffect, "gap", 1);
@@ -329,13 +344,13 @@ Item {
329344
330345 function test_filter_expand_expand_collapse() {
331346 // wait for the item to be there
332− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
347+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderapplications.scope") != null; }, true);
333348
334349 var categoryListView = findChild(genericScopeView, "categoryListView");
335350 categoryListView.contentY = categoryListView.height;
336351
337− var header2 = findChild(genericScopeView, "dashSectionHeader2")
338− var category2 = findChild(genericScopeView, "dashCategory2")
352+ var header2 = findChild(genericScopeView, "dashSectionHeaderapplications.scope")
353+ var category2 = findChild(genericScopeView, "dashCategoryapplications.scope")
339354 var category2FilterGrid = category2.children[0].children[0].children[0];
340355 verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
341356
@@ -368,6 +383,21 @@ Item {
368383 tryCompare(category2, "filtered", true);
369384 }
370385
386+ function test_bug1271676_no_move_y_no_preview() {
387+ waitForRendering(genericScopeView);
388+ var categoryListView = findChild(genericScopeView, "categoryListView");
389+ waitForRendering(categoryListView);
390+ tryCompareFunction(function() { return findChild(genericScopeView, "dashCategoryapplications.scope") != null; }, true);
391+ var category = findChild(genericScopeView, "dashCategoryapplications.scope")
392+ categoryListView.contentY = category.y;
393+ waitForRendering(categoryListView);
394+ var contentYBefore = categoryListView.contentY
395+ openPreview("applications.scope", false); // This actually doesn't open anything because we
396+ // have code so that the item of installed
397+ // does activate instead of preview and never shows a preview
398+ compare(categoryListView.contentY, contentYBefore);
399+ }
400+
371401 function test_narrow_delegate_ranges_expand() {
372402 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
373403 var category = findChild(genericScopeView, "dashCategory0")