@@ -127,6 +127,33 @@ Item {
127 scopesModel.clear();
127 scopesModel.clear();
128 // wait for dash to empty scopes.
128 // wait for dash to empty scopes.
129 tryCompare(dashContentList, "count", 0);
129 tryCompare(dashContentList, "count", 0);
130+ // this is the default state for empty model
131+ dashContentList.currentIndex = -1;
134+ function test_current_index() {
135+ var dashContentList = findChild(dashContent, "dashContentList");
136+ verify(dashContentList != undefined)
138+ compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
139+ compare(dashContentList.currentIndex, -1, "DashContent's currentIndex should be -1 while there have been no items in the model");
141+ tryCompare(scopeLoadedSpy, "count", 5);
143+ verify(dashContentList.currentIndex >= 0);
146+ function test_current_index_after_reset() {
147+ var dashContentList = findChild(dashContent, "dashContentList");
148+ verify(dashContentList != undefined)
150+ compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
151+ // pretend we're running after a model reset
152+ dashContentList.currentIndex = 27;
154+ tryCompare(scopeLoadedSpy, "count", 5);
156+ verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
132 function test_movement_started_signal() {
159 function test_movement_started_signal() {