on xenial help sign in
Adapt test
commit93a63d190780d7b9815b4b6d0b2912f339ddfde1 authorAlbert Astals <albert.astals@canonical.com> dateThu 7 Aug 2014, 11:50 (12 years ago) parent6f38c49
1 file changed+12−9
tests/qmltests/Dash/tst_GenericScopeView.qml+12−9
tests/qmltests/Dash/tst_GenericScopeView.qml+12−9
@@ -61,8 +61,8 @@ Item {
6161 property Item header: findChild(genericScopeView, "scopePageHeader")
6262
6363 function init() {
64− genericScopeView.scope = scopes.getScope(1)
65− shell.width = units.gu(120)
64+ genericScopeView.scope = scopes.getScope(2);
65+ shell.width = units.gu(120);
6666 genericScopeView.categoryView.positionAtBeginning();
6767 waitForRendering(genericScopeView.categoryView);
6868 }
@@ -88,13 +88,13 @@ Item {
8888
8989 function test_showDash() {
9090 testCase.previewListView.open = true;
91− scopes.getScope(1).showDash();
91+ genericScopeView.scope.showDash();
9292 tryCompare(testCase.previewListView, "open", false);
9393 }
9494
9595 function test_hideDash() {
9696 testCase.previewListView.open = true;
97− scopes.getScope(1).hideDash();
97+ genericScopeView.scope.hideDash();
9898 tryCompare(testCase.previewListView, "open", false);
9999 }
100100
@@ -111,8 +111,9 @@ Item {
111111
112112 function test_changeScope() {
113113 genericScopeView.scope.searchQuery = "test"
114− genericScopeView.scope = scopes.getScope(2)
115− genericScopeView.scope = scopes.getScope(1)
114+ var originalScopeId = genericScopeView.scope.id;
115+ genericScopeView.scope = scopes.getScope(originalScopeId + 1)
116+ genericScopeView.scope = scopes.getScope(originalScopeId)
116117 tryCompare(genericScopeView.scope, "searchQuery", "test")
117118 }
118119
@@ -198,6 +199,8 @@ Item {
198199 openPreview(4, 0);
199200
200201 compare(testCase.previewListView.count, 12, "There should only be 12 items in preview.");
202+
203+ closePreview();
201204 }
202205
203206 function test_narrow_delegate_ranges_expand() {
@@ -232,7 +235,7 @@ Item {
232235 }
233236
234237 function test_single_category_expansion() {
235− genericScopeView.scope = scopes.getScope(4);
238+ genericScopeView.scope = scopes.getScope(3);
236239
237240 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
238241 var category = findChild(genericScopeView, "dashCategory0")
@@ -329,8 +332,8 @@ Item {
329332 function test_header_style_data() {
330333 return [
331334 { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
332− { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
333− { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
335+ { tag: "Foreground", index: 1, foreground: "yellow", background: "", logo: "" },
336+ { tag: "Logo+Background", index: 2, foreground: "grey", background: "gradient:///lightgrey/grey",
334337 logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
335338 ];
336339 }