70
70
function loadScopes() {
71
71
scopeLoadedSpy.clear();
72
72
scopesModel.load();
73
tryCompare(scopeLoadedSpy, "count", 6, 15000);
73
tryCompare(scopeLoadedSpy, "count", 8, 15000);
74
74
tryCompare(scopesModel, "loaded", true);
75
75
tryCompareFunction(function() {
76
76
var mockScope1Loader = findChild(shell, "scopeLoader0");
215
215
verify(pageHeader, "Could not find the scope page header.");
216
216
var innerHeader = findChild(pageHeader, "innerPageHeader");
217
217
verify(innerHeader, "Could not find the scope page header.");
218
compare(innerHeader.config.title, scopesModel.getScope(data.index).name);
218
compare(innerHeader.title, scopesModel.getScope(data.index).name);
221
221
function test_is_active_data() {
517
517
function test_navigationShowFilterPopup() {
520
518
var dashContentList = findChild(dashContent, "dashContentList");
519
var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader")
521
520
var settingsButton = findChild(dashContentList.currentItem, "settingsButton");
521
var searchButton = findChild(dashContentList.currentItem, "search_button");
522
var cancelButton = findChild(dashContentList.currentItem, "cancelButton");
523
var searchTextField = findChild(pageHeader, "searchTextField");
524
var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
525
var headerContainer = findChild(pageHeader, "headerContainer");
527
// test that closing the filters popover without a search unfocuses and removes the navigation
528
mouseClick(searchButton);
529
tryCompare(peExtraPanel, "visible", true);
523
531
var filtersPopover = findChild(shell, "filtersPopover")
524
532
verify(!filtersPopover);
526
534
mouseClick(settingsButton);
528
536
filtersPopover = findChild(shell, "filtersPopover")
530
verify(filtersPopover);
537
verify(filtersPopover);
539
mouseClick(shell, shell.width - 1, shell.height - 1);
541
tryCompare(pageHeader.extraPanel, "visible", false);
542
tryCompare(headerContainer, "showSearch", true);
543
tryCompare(searchTextField, "focus", false);
545
mouseClick(cancelButton);
546
tryCompare(headerContainer, "showSearch", false);
547
tryCompare(headerContainer, "contentY", headerContainer.height);
549
// test within a navigation
552
filtersPopover = findChild(shell, "filtersPopover")
553
verify(!filtersPopover);
555
mouseClick(settingsButton);
557
filtersPopover = findChild(shell, "filtersPopover")
558
verify(filtersPopover);
560
mouseClick(shell, shell.width - 1, shell.height - 1);
562
tryCompare(pageHeader.extraPanel, "visible", false);
563
tryCompare(headerContainer, "showSearch", true);
533
566
function test_primaryFilter() {
579
612
function test_noDelegateCreationDestructionOnMove() {
613
// Go to scope 1 and back so that items are created
614
// and so this test makes sense
615
dashContent.setCurrentScopeAtIndex(1);
616
waitForRendering(dashContent);
617
dashContent.setCurrentScopeAtIndex(0);
580
619
// Our cards are of type AbstractButton as defined in CardCreator.js
581
620
// This gives also other things that are not cards but for our purpose it
582
621
// does not matter
625
664
tryCompareFunction(function() { return dashContentList.currentItem.item.scope.id == nextScopeId; }, true);
626
665
compare(dashContentList.currentIndex, 0);
668
function test_extraPanel() {
669
var dashContentList = findChild(dashContent, "dashContentList");
670
var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader")
671
pageHeader.searchEntryEnabled = true;
672
pageHeader.searchHistory.clear();
674
pageHeader.searchHistory.addQuery("Search1");
675
pageHeader.searchHistory.addQuery("Search2");
677
pageHeader.triggerSearch();
678
tryCompare(pageHeader.extraPanel, "visible", true);
680
var searchTextField = findChild(pageHeader, "searchTextField");
681
compare(searchTextField.focus, true);
683
var recentSearches = findChild(pageHeader.extraPanel, "recentSearchesRepeater");
684
verify(recentSearches, "Could not find recent searches");
686
waitForRendering(recentSearches);
688
mouseClick(recentSearches.itemAt(0));
689
compare(pageHeader.searchQuery, "Search2");
690
tryCompare(pageHeader.extraPanel, "visible", false);
691
compare(searchTextField.focus, false);