@@ -67,13 +67,17 @@ Item {
67 name: "DashContent"
67 name: "DashContent"
68 when: scopesModel.loaded && windowShown
68 when: scopesModel.loaded && windowShown
70− function init() {
70+ function loadScopes() {
72 scopeLoadedSpy.clear();
71 scopeLoadedSpy.clear();
73 scopesModel.load();
72 scopesModel.load();
74 tryCompare(scopeLoadedSpy, "count", 4);
73 tryCompare(scopeLoadedSpy, "count", 4);
77 function cleanup() {
81 function cleanup() {
78 movementStartedSpy.clear();
82 movementStartedSpy.clear();
79 dashContent.visible = true;
83 dashContent.visible = true;
@@ -93,9 +97,7 @@ Item {
93 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
97 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
94 tryCompare(dashContentList, "currentIndex", -1);
98 tryCompare(dashContentList, "currentIndex", -1);
96− scopeLoadedSpy.clear();
100+ loadScopes();
98− tryCompare(scopeLoadedSpy, "count", 4);
100 verify(dashContentList.currentIndex >= 0);
102 verify(dashContentList.currentIndex >= 0);
@@ -109,9 +111,7 @@ Item {
109 // pretend we're running after a model reset
111 // pretend we're running after a model reset
110 dashContentList.currentIndex = 27;
112 dashContentList.currentIndex = 27;
112− scopeLoadedSpy.clear();
114+ loadScopes();
114− tryCompare(scopeLoadedSpy, "count", 4);
116 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
116 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
@@ -326,8 +326,6 @@ Item {
328 function test_previewOpenClose() {
328 function test_previewOpenClose() {
329− tryCompare(scopeLoadedSpy, "count", 4);
331 var previewListView = findChild(dashContent, "dashContentPreviewList");
329 var previewListView = findChild(dashContent, "dashContentPreviewList");
332 tryCompare(previewListView, "open", false);
330 tryCompare(previewListView, "open", false);
@@ -352,8 +350,6 @@ Item {
355− tryCompare(scopeLoadedSpy, "count", 4);
357 var previewListView = findChild(dashContent, "dashContentPreviewList");
353 var previewListView = findChild(dashContent, "dashContentPreviewList");
358 tryCompare(previewListView, "open", false);
354 tryCompare(previewListView, "open", false);
@@ -368,8 +364,6 @@ Item {
370 function test_previewCycle() {
366 function test_previewCycle() {
371− tryCompare(scopeLoadedSpy, "count", 4);
373 var categoryListView = findChild(dashContent, "categoryListView");
367 var categoryListView = findChild(dashContent, "categoryListView");
374 categoryListView.positionAtBeginning();
368 categoryListView.positionAtBeginning();
@@ -392,5 +386,26 @@ Item {
393 closePreview();
387 closePreview();
390+ function test_carouselAspectRatio() {
391+ tryCompareFunction(function() {
392+ var scope = findChild(dashContent, "MockScope1 loader");
393+ if (scope != null) {
394+ var dashCategory1 = findChild(scope, "dashCategory1");
395+ if (dashCategory1 != null) {
396+ var tile = findChild(dashCategory1, "carouselDelegate1");
397+ return tile != null;
404+ var scope = findChild(dashContent, "MockScope1 loader");
405+ var dashCategory1 = findChild(scope, "dashCategory1");
406+ var cardTool = findChild(dashCategory1, "cardTool");
407+ var carouselLV = findChild(dashCategory1, "listView");
408+ verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]);