@@ -16,6 +16,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19+import Ubuntu.Components 1.1
19import "../../../qml/Dash"
20import "../../../qml/Dash"
20import Unity.Test 0.1 as UT
21import Unity.Test 0.1 as UT
21import Unity 0.2 as Unity
22import Unity 0.2 as Unity
@@ -39,7 +40,9 @@ Rectangle {
39 id: listView
40 id: listView
40 anchors.fill: parent
41 anchors.fill: parent
41 scope: mockScope
42 scope: mockScope
42− scopeStyle: ScopeStyle { }
43+ scopeStyle: ScopeStyle {
44+ style: mockScope.customizations
45 UT.UnityTestCase {
48 UT.UnityTestCase {
@@ -83,5 +86,30 @@ Rectangle {
83 mouseClick(listView, listView.width / 2, listView.height / 2);
86 mouseClick(listView, listView.width / 2, listView.height / 2);
84 clickedSpy.wait();
87 clickedSpy.wait();
90+ function test_title() {
91+ var header = findChild(listView, "innerPageHeader");
92+ verify(header, "Could not find the preview header");
94+ compare(header.title, "Mock Scope");
97+ function test_header_style() {
98+ var header = findChild(listView, "pageHeader");
99+ verify(header, "Could not find the header");
101+ var innerHeader = findChild(header, "innerPageHeader");
102+ verify(innerHeader, "Could not find the inner header");
103+ verify(Qt.colorEqual(innerHeader.textColor, UbuntuColors.darkGrey),
104+ "Foreground color not equal: %1 != %2".arg(innerHeader.textColor).arg(UbuntuColors.darkGrey));
106+ var background = findChild(header, "headerBackground");
107+ verify(background, "Could not find the background");
108+ compare(background.style, "gradient:///lightgrey/grey");
110+ var image = findChild(header, "titleImage");
111+ verify(image, "Could not find the title image.");
112+ compare(image.source, Qt.resolvedUrl("../Dash/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");