@@ -415,6 +415,34 @@ Item {
415415 verify(image, "Could not find the title image.");
416416 compare(image.source, data.logo, "Title image has the wrong source");
417417 }
418+
419+ function test_favorite_data() {
420+ return [
421+ { tag: "People", id: "MockScope1", favorite: true },
422+ { tag: "Music", id: "MockScope2", favorite: false },
423+ { tag: "Apps", id: "clickscope", favorite: true },
424+ ];
425+ }
426+
427+ function test_favorite(data) {
428+ genericScopeView.scope = scopes.getScopeFromAll(data.id);
429+ waitForRendering(genericScopeView);
430+ verify(header, "Could not find the header.");
431+
432+ compare(genericScopeView.scope.favorite, data.favorite, "Unexpected initial favorite value");
433+
434+ var innerHeader = findChild(header, "innerPageHeader");
435+ verify(innerHeader, "Could not find the inner header");
436+
437+ expectFail("Apps", "Click scope should not have a favorite button");
438+ var favoriteAction = findChild(innerHeader, "favorite_header_button");
439+ verify(favoriteAction, "Could not find the favorite action.");
440+ mouseClick(favoriteAction, 0, 0);
441+
442+ tryCompare(genericScopeView.scope, "favorite", !data.favorite);
443+
444+ genericScopeView.scope = !genericScopeView.scope;
445+ }
418446 }
419447 }
420448}