@@ -127,6 +127,33 @@ Item {
127127 scopesModel.clear();
128128 // wait for dash to empty scopes.
129129 tryCompare(dashContentList, "count", 0);
130+ // this is the default state for empty model
131+ dashContentList.currentIndex = -1;
132+ }
133+
134+ function test_current_index() {
135+ var dashContentList = findChild(dashContent, "dashContentList");
136+ verify(dashContentList != undefined)
137+
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");
140+
141+ tryCompare(scopeLoadedSpy, "count", 5);
142+
143+ verify(dashContentList.currentIndex >= 0);
144+ }
145+
146+ function test_current_index_after_reset() {
147+ var dashContentList = findChild(dashContent, "dashContentList");
148+ verify(dashContentList != undefined)
149+
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;
153+
154+ tryCompare(scopeLoadedSpy, "count", 5);
155+
156+ verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
130157 }
131158
132159 function test_movement_started_signal() {