@@ -54,6 +54,7 @@ Item {
5454 when: scopes.loaded && windowShown
5555
5656 property Item previewListView: findChild(genericScopeView, "previewListView")
57+ property Item header: findChild(genericScopeView, "scopePageHeader")
5758
5859 function init() {
5960 genericScopeView.scope = scopes.getScope(1)
@@ -257,13 +258,33 @@ Item {
257258 closePreview();
258259 }
259260
260− function test_haeder_logo() {
261− genericScopeView.scope = scopes.getScope(3);
261+ function test_header_style_data() {
262+ return [
263+ { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
264+ { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
265+ { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
266+ logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
267+ ];
268+ }
262269
263− var image = findChild(genericScopeView, "titleImage");
264− verify(image, "Could not find the title image");
265− compare(image.source, Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
270+ function test_header_style(data) {
271+ genericScopeView.scope = scopes.getScope(data.index);
272+ waitForRendering(genericScopeView);
273+ verify(header, "Could not find the header.");
266274
275+ var innerHeader = findChild(header, "innerPageHeader");
276+ verify(innerHeader, "Could not find the inner header");
277+ verify(Qt.colorEqual(innerHeader.textColor, data.foreground),
278+ "Foreground color not equal: %1 != %2".arg(innerHeader.textColor).arg(data.foreground));
279+
280+ var background = findChild(header, "headerBackground");
281+ verify(background, "Could not find the background");
282+ compare(background.style, data.background);
283+
284+ var image = findChild(genericScopeView, "titleImage");
285+ if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
286+ verify(image, "Could not find the title image.");
287+ compare(image.source, data.logo, "Title image has the wrong source");
267288 }
268289 }
269290 }