on xenial help sign in
Don't break other tests that use expect the apps scope to be somewhere else
commita91da859209efe2affa869bedea83b498d764942 authorAlbert Astals <albert.astals@canonical.com> dateWed 29 Jan 2014, 17:40 (13 years ago) parentda2114c
3 files changed+18−18
tests/mocks/Unity/fake_scope.cpp+1−1 tests/mocks/Unity/fake_scopes.cpp+1−1 tests/qmltests/Dash/tst_GenericScopeView.qml+16−16
tests/mocks/Unity/fake_scope.cpp+1−1
@@ -202,7 +202,7 @@ DeeModel* create_categories_model(unsigned category_count) {
202202 for(unsigned i = 0; i < category_count; ++i)
203203 {
204204 dee_model_append(category_model,
205− (i == 2) ? "installed" : std::to_string(i).c_str(),
205+ (i == 2) ? "applications.scope" : std::to_string(i).c_str(),
206206 ("Category "+std::to_string(i)).c_str(),
207207 "gtk-apply",
208208 i % 2 == 0 ? "grid" : "carousel",
tests/mocks/Unity/fake_scopes.cpp+1−1
@@ -54,7 +54,7 @@ Scopes::~Scopes()
5454void Scopes::updateScopes()
5555{
5656 clear();
57− addScope(new Scope("applications.scope", "People", true, this));
57+ addScope(new Scope("MockScope1", "People", true, this));
5858 addScope(new Scope("MockScope2", "Music", false, this));
5959 addScope(new Scope("home.scope", "Home", true, this));
6060 addScope(new ApplicationsScope(true, this));
tests/qmltests/Dash/tst_GenericScopeView.qml+16−16
@@ -32,7 +32,7 @@ Item {
3232 id: scopes
3333
3434 onLoadedChanged: {
35− genericScopeView.scope = scopes.get(0)
35+ genericScopeView.scope = scopes.get(2)
3636 }
3737 }
3838
@@ -76,14 +76,14 @@ Item {
7676 function test_showDash() {
7777 previewListView.open = true;
7878 tryCompare(openEffect, "live", true);
79− scopes.get(0).showDash();
79+ scopes.get(2).showDash();
8080 tryCompare(previewListView, "open", false);
8181 tryCompare(openEffect, "live", true);
8282 }
8383
8484 function test_hideDash() {
8585 previewListView.open = true;
86− scopes.get(0).hideDash();
86+ scopes.get(2).hideDash();
8787 tryCompare(previewListView, "open", false);
8888 }
8989
@@ -96,7 +96,7 @@ Item {
9696 var filterGrid = findChild(genericScopeView, filterGridName);
9797 if (filterGrid != null) {
9898 var tile = findChild(filterGrid, "delegate0");
99− return tile != undefined;
99+ return tile != null;
100100 }
101101 return false;
102102 },
@@ -110,7 +110,7 @@ Item {
110110 function checkArrowPosition(index) {
111111 tryCompareFunction(function() {
112112 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
113− return tile != undefined;
113+ return tile != null;
114114 },
115115 true);
116116 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
@@ -254,13 +254,13 @@ Item {
254254 function test_changeScope() {
255255 genericScopeView.scope.searchQuery = "test"
256256 genericScopeView.scope = scopes.get(1)
257− genericScopeView.scope = scopes.get(0)
257+ genericScopeView.scope = scopes.get(2)
258258 tryCompare(genericScopeView.scope, "searchQuery", "")
259259 }
260260
261261 function test_filter_expand_collapse() {
262262 // wait for the item to be there
263− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != undefined; }, true);
263+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
264264
265265 var header = findChild(genericScopeView, "dashSectionHeader0")
266266 var category = findChild(genericScopeView, "dashCategory0")
@@ -282,7 +282,7 @@ Item {
282282 }
283283
284284 function test_showPreviewCarousel() {
285− tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
285+ tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != null; }, true);
286286 var tile = findChild(genericScopeView, "carouselDelegate");
287287 mouseClick(tile, tile.width / 2, tile.height / 2);
288288 tryCompare(openEffect, "gap", 1);
@@ -310,13 +310,13 @@ Item {
310310
311311 function test_filter_expand_expand() {
312312 // wait for the item to be there
313− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderinstalled") != undefined; }, true);
313+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderapplications.scope") != null; }, true);
314314
315315 var categoryListView = findChild(genericScopeView, "categoryListView");
316316 categoryListView.contentY = categoryListView.height;
317317
318− var header2 = findChild(genericScopeView, "dashSectionHeaderinstalled")
319− var category2 = findChild(genericScopeView, "dashCategoryinstalled")
318+ var header2 = findChild(genericScopeView, "dashSectionHeaderapplications.scope")
319+ var category2 = findChild(genericScopeView, "dashCategoryapplications.scope")
320320 var category2FilterGrid = category2.children[0].children[0].children[0];
321321 verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
322322
@@ -346,17 +346,17 @@ Item {
346346 tryCompare(category2FilterGrid, "filter", true);
347347 }
348348
349− function test_no_move_y_no_preview() {
349+ function test_bug1271676_no_move_y_no_preview() {
350350 waitForRendering(genericScopeView);
351351 var categoryListView = findChild(genericScopeView, "categoryListView");
352352 waitForRendering(categoryListView);
353− var category = findChild(genericScopeView, "dashCategoryinstalled")
353+ var category = findChild(genericScopeView, "dashCategoryapplications.scope")
354354 categoryListView.contentY = category.y;
355355 waitForRendering(categoryListView);
356356 var contentYBefore = categoryListView.contentY
357− openPreview("installed", false); // This actually doesn't open anything because we
358− // have code so that the item of installed
359− // does activate instead of preview and never shows a preview
357+ openPreview("applications.scope", false); // This actually doesn't open anything because we
358+ // have code so that the item of installed
359+ // does activate instead of preview and never shows a preview
360360 compare(categoryListView.contentY, contentYBefore);
361361 }
362362 }