on xenial help sign in
Make sure attributes is always defined in mock overview scope.
3eb4c4bMichał Sawicz
tests/mocks/Unity/fake_scopesoverview.cpp+4−2
@@ -105,11 +105,12 @@ ScopesOverviewCategories::data(const QModelIndex& index, int role) const
105 }
105 }
106 case RoleComponents:
106 case RoleComponents:
107 {
107 {
108− QVariantMap map, artMap;
108+ QVariantMap map, artMap, attributesMap;
109 artMap["aspect-ratio"] = "0.5";
109 artMap["aspect-ratio"] = "0.5";
110 artMap["field"] = "art";
110 artMap["field"] = "art";
111 map["art"] = artMap;
111 map["art"] = artMap;
112 map["title"] = "HOLA";
112 map["title"] = "HOLA";
113+ map["attributes"] = attributesMap;
113 return map;
114 return map;
114 }
115 }
115 case RoleResults:
116 case RoleResults:
@@ -188,11 +189,12 @@ ScopesOverviewSearchCategories::data(const QModelIndex& index, int role) const
188 }
189 }
189 case RoleComponents:
190 case RoleComponents:
190 {
191 {
191− QVariantMap map, artMap;
192+ QVariantMap map, artMap, attributesMap;
192 artMap["aspect-ratio"] = "1";
193 artMap["aspect-ratio"] = "1";
193 artMap["field"] = "art";
194 artMap["field"] = "art";
194 map["art"] = artMap;
195 map["art"] = artMap;
195 map["title"] = "HOLA";
196 map["title"] = "HOLA";
197+ map["attributes"] = attributesMap;
196 return map;
198 return map;
197 }
199 }
198 case RoleResults:
200 case RoleResults:
tests/qmltests/Dash/tst_Dash.qml+2
@@ -273,6 +273,8 @@ Item {
273 // Click on a temp scope in the search
273 // Click on a temp scope in the search
274 var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");
274 var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");
275 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
275 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
276+ verify(cardTempScope, "Could not find delegate2");
277+
276 waitForRendering(cardTempScope);
278 waitForRendering(cardTempScope);
277 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
279 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
278
280