@@ -0,0 +1,87 @@
2+ * Copyright (C) 2013 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+import Ubuntu.Components 1.3
20+import Unity.Test 0.1 as UT
21+import "../../../qml/Dash"
22+import "CardHelpers.js" as Helpers
30+ property var overlaidTemplate: {"card-layout":"vertical", "card-size":"small", "category-layout":"carousel", "overlay": true }
31+ property var nonOverlaidTemplate: {"card-layout":"vertical", "card-size":"small", "category-layout":"carousel" }
36+ objectName: "cardTool"
37+ template: nonOverlaidTemplate
38+ components: {"art":{"aspect-ratio":1.6,"field":"art"}, "title":{"field":"title"}, "attributes":{}}
39+ viewWidth: parent.width
45+ Component.onCompleted: {
46+ cTool.templateChanged();
47+ for (var i = 0; i < cTool.count; ++i) {
48+ lModel.append( { title: "fqg\nfqg", art: Qt.resolvedUrl("artwork/music-player-design.png").toString() } );
57+ height: expandedHeight
73+ function test_non_overlaid_header_layout() {
74+ // When the header is non overlaid
75+ // we grow down to accomodate the header but the y of the list is the same
76+ var listView = findChild(cardCarousel, "listView");
78+ cTool.template = overlaidTemplate;
79+ var yPos = listView.y;
80+ var height = cardCarousel.height;
82+ cTool.template = nonOverlaidTemplate;
83+ compare(listView.y, yPos);
84+ compare(cardCarousel.height, height + cTool.headerHeight);