@@ -106,7 +106,7 @@ Item {
106 contentEndReachedSpy.clear()
106 contentEndReachedSpy.clear()
107 clear_scope_status();
107 clear_scope_status();
109− // clear, wait for dahs to empty and load scopes.
109+ // clear, wait for dash to empty and load scopes.
110 var dashContentList = findChild(dashContent, "dashContentList");
110 var dashContentList = findChild(dashContent, "dashContentList");
111 verify(dashContentList != undefined)
111 verify(dashContentList != undefined)
112 scopesModel.clear();
112 scopesModel.clear();
@@ -178,6 +178,24 @@ Item {
178 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
178 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
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;
188+ waitForRendering(itemBeforeSwitching)
190+ itemBeforeSwitching.item.previewShown = true;
194+ dashContent.setCurrentScopeAtIndex(next_index, true, false);
195+ tryCompare(dashContent, "currentIndex", next_index);
196+ compare(itemBeforeSwitching.item.previewShown, false);
181 function get_current_item_object_name() {
199 function get_current_item_object_name() {
182 var dashContentList = findChild(dashContent, "dashContentList");
200 var dashContentList = findChild(dashContent, "dashContentList");
183 verify(dashContentList != undefined);
201 verify(dashContentList != undefined);