@@ -105,25 +105,19 @@ Item {
105105 signalName: "movementStarted"
106106 }
107107
108− SignalSpy {
109− id: contentEndReachedSpy
110− target: dashContent
111− signalName: "contentEndReached"
112− }
113−
114108 UT.UnityTestCase {
115109 name: "DashContent"
116110 when: scopesModel.loaded
117111
118112 function init() {
119113 scopesModel.clear();
114+ scopeLoadedSpy.clear();
120115 scopesModel.load();
116+ tryCompare(scopeLoadedSpy, "count", 5);
121117 }
122118
123119 function cleanup() {
124− scopeLoadedSpy.clear();
125120 movementStartedSpy.clear();
126− contentEndReachedSpy.clear();
127121 clear_scope_status();
128122 dashContent.visible = true;
129123
@@ -132,17 +126,18 @@ Item {
132126 scopesModel.clear();
133127 // wait for dash to empty scopes.
134128 tryCompare(dashContentList, "count", 0);
135− // this is the default state for empty model
136− dashContentList.currentIndex = -1;
137129 }
138130
139131 function test_current_index() {
140132 var dashContentList = findChild(dashContent, "dashContentList");
141133 verify(dashContentList != undefined)
142134
135+ scopesModel.clear();
143136 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
144− compare(dashContentList.currentIndex, -1, "DashContent's currentIndex should be -1 while there have been no items in the model");
137+ tryCompare(dashContentList, "currentIndex", -1);
145138
139+ scopeLoadedSpy.clear();
140+ scopesModel.load();
146141 tryCompare(scopeLoadedSpy, "count", 5);
147142
148143 verify(dashContentList.currentIndex >= 0);
@@ -152,10 +147,13 @@ Item {
152147 var dashContentList = findChild(dashContent, "dashContentList");
153148 verify(dashContentList != undefined)
154149
155− compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
150+ scopesModel.clear();
151+ compare(dashContentList.count, 0, "DashContent should have 0 items after clearing");
156152 // pretend we're running after a model reset
157153 dashContentList.currentIndex = 27;
158154
155+ scopeLoadedSpy.clear();
156+ scopesModel.load();
159157 tryCompare(scopeLoadedSpy, "count", 5);
160158
161159 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
@@ -167,8 +165,6 @@ Item {
167165 var dashContentList = findChild(dashContent, "dashContentList");
168166 verify(dashContentList != undefined)
169167
170− tryCompare(scopeLoadedSpy, "count", 5);
171−
172168 dashContentList.movementStarted();
173169
174170 compare(movementStartedSpy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
@@ -182,8 +178,6 @@ Item {
182178 function test_positioned_at_beginning_signal() {
183179 dashContent.setCurrentScopeAtIndex(3, true, false);
184180
185− tryCompare(scopeLoadedSpy, "count", 5);
186−
187181 dashContent.positionedAtBeginning();
188182 compare(scopeStatus["MockScope1"].positionedAtBeginning, 1, "MockScope1 should have emitted positionedAtBeginning signal when DashContent did.");
189183 compare(scopeStatus["MockScope2"].positionedAtBeginning, 1, "MockScope2 should have emitted positionedAtBeginning signal when DashContent did.");
@@ -192,30 +186,17 @@ Item {
192186 compare(scopeStatus["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
193187 }
194188
195− function test_scope_loaded() {
196− tryCompare(scopeLoadedSpy, "count", 5);
197− }
198−
199− function test_content_end_reached() {
200− var dashContentList = findChild(dashContent, "dashContentList");
201− verify(dashContentList != undefined);
202−
203− tryCompare(scopeLoadedSpy, "count", 5);
204− dashContent.setCurrentScopeAtIndex(0, true, false);
205− dashContentList.currentItem.item.endReached();
206−
207− compare(contentEndReachedSpy.count, 1);
208− }
209−
210189 // This tests that setting the current scope index will end up at the correct index even if
211190 // the scopes are loaded asynchrounsly.
212191 function test_set_current_scope_index_async() {
192+ scopesModel.clear();
213193 verify(scopesModel.loaded == false);
214194
215− // next index is 1 if current is -1, otherwise it's current + 1
216− var next_index = ((dashContent.currentIndex == -1 ? 0 : dashContent.currentIndex) + 1) % 5
195+ tryCompare(dashContent, "currentIndex", -1);
196+ var next_index = 1
217197
218198 dashContent.setCurrentScopeAtIndex(next_index, true, false);
199+ scopesModel.load();
219200 tryCompare(dashContent, "currentIndex", next_index);
220201 verify(scopesModel.loaded == true);
221202
@@ -265,8 +246,6 @@ Item {
265246 function test_is_active(data) {
266247 var dashContentList = findChild(dashContent, "dashContentList");
267248
268− tryCompare(scopeLoadedSpy, "count", 5);
269−
270249 dashContent.setCurrentScopeAtIndex(data.select, true, false);
271250 dashContent.visible = data.visible;
272251