@@ -106,7 +106,7 @@ Item {
106106 contentEndReachedSpy.clear()
107107 clear_scope_status();
108108
109− // clear, wait for dahs to empty and load scopes.
109+ // clear, wait for dash to empty and load scopes.
110110 var dashContentList = findChild(dashContent, "dashContentList");
111111 verify(dashContentList != undefined)
112112 scopesModel.clear();
@@ -178,6 +178,24 @@ Item {
178178 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
179179 }
180180
181+ function test_set_current_scope_index_closes_preview() {
182+ var dashContentList = findChild(dashContent, "dashContentList");
183+ tryCompare(dashContentList, "count", 5);
184+ dashContentList.currentIndex = 0;
185+ tryCompare(dashContentList.currentItem, "progress", 1);
186+ var itemBeforeSwitching = dashContentList.currentItem;
187+
188+ waitForRendering(itemBeforeSwitching)
189+
190+ itemBeforeSwitching.item.previewShown = true;
191+
192+ var next_index = 1;
193+
194+ dashContent.setCurrentScopeAtIndex(next_index, true, false);
195+ tryCompare(dashContent, "currentIndex", next_index);
196+ compare(itemBeforeSwitching.item.previewShown, false);
197+ }
198+
181199 function get_current_item_object_name() {
182200 var dashContentList = findChild(dashContent, "dashContentList");
183201 verify(dashContentList != undefined);