@@ -70,6 +70,15 @@ Rectangle {
7070
7171 when: windowShown
7272
73+ function findScale(item) {
74+ var scale = 1;
75+ while (item) {
76+ scale = scale * item.scale;
77+ item = item.parent;
78+ }
79+ return scale;
80+ }
81+
7382 function test_non_overlaid_header_layout() {
7483 // When the header is non overlaid
7584 // we grow down to accomodate the header but the y of the list is the same
@@ -83,5 +92,20 @@ Rectangle {
8392 compare(listView.y, yPos);
8493 compare(cardCarousel.height, height + cTool.headerHeight);
8594 }
95+
96+ function test_item_fits_view_data() {
97+ return [
98+ {tag: "overlaid", template: overlaidTemplate},
99+ {tag: "nonOverlaid", template: nonOverlaidTemplate},
100+ ];
101+ }
102+
103+ function test_item_fits_view(data) {
104+ cTool.template = data.template;
105+ var delegate0 = findChild(cardCarousel, "carouselDelegate0");
106+ tryCompareFunction(function() { return delegate0.item != null; }, true);
107+ var scale = findScale(delegate0.item);
108+ verify(delegate0.item.implicitHeight * scale < cardCarousel.height);
109+ }
86110 }
87111}