@@ -124,13 +124,13 @@ Item {
124124
125125 waitForRendering(categoryListView);
126126
127− categoryListView.contentY = units.gu(11);
128− console.log("contentY", categoryListView.contentY);
127+ categoryListView.contentY = units.gu(15);
128+ tryCompare(categoryListView, "contentY", units.gu(15));
129129
130130 var startX = dashContentList.width/2;
131131 var startY = dashContentList.height/2;
132132 touchFlick(dashContentList, startX - units.gu(2), startY, startX, startY);
133− tryCompare(categoryListView, "contentY", units.gu(11) - categoryListView.pageHeader.height);
133+ tryCompare(categoryListView, "contentY", units.gu(15) - categoryListView.pageHeader.height);
134134 }
135135
136136 function test_set_current_scope_reset() {
@@ -407,5 +407,116 @@ Item {
407407 var carouselLV = findChild(dashCategory1, "listView");
408408 verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]);
409409 }
410+
411+ function test_departments() {
412+ var dashDepartments = findChild(dashContent, "dashDepartments");
413+ compare(dashDepartments.visible, true);
414+ compare(dashDepartments.showList, false);
415+ waitForRendering(dashDepartments);
416+ mouseClick(dashDepartments, 0, 0);
417+ compare(dashDepartments.showList, true);
418+
419+ var departmentListView = findChild(dashDepartments, "departmentListView");
420+ compare(departmentListView.count, 1);
421+ tryCompare(departmentListView.currentItem.department, "loaded", true);
422+
423+ waitForRendering(departmentListView);
424+ waitForRendering(departmentListView.currentItem);
425+
426+ var allButton = findChild(dashDepartments, "allButton");
427+ compare(allButton.visible, false);
428+
429+ var department = findChild(dashDepartments, "department0child3");
430+ mouseClick(department, 0, 0);
431+ compare(dashDepartments.showList, false);
432+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3");
433+ tryCompare(departmentListView.currentItem.department, "departmentId", "root");
434+
435+ mouseClick(dashDepartments, 0, 0);
436+ compare(dashDepartments.showList, true);
437+ waitForRendering(departmentListView);
438+ waitForRendering(departmentListView.currentItem);
439+ compare(allButton.visible, true);
440+
441+ mouseClick(allButton, 0, 0);
442+ compare(dashDepartments.showList, false);
443+ tryCompare(dashDepartments.currentDepartment, "departmentId", "root");
444+ tryCompare(departmentListView.currentItem.department, "departmentId", "root");
445+
446+ mouseClick(dashDepartments, 0, 0);
447+ compare(dashDepartments.showList, true);
448+ waitForRendering(departmentListView);
449+ waitForRendering(departmentListView.currentItem);
450+ compare(allButton.visible, false);
451+
452+ department = findChild(dashDepartments, "department0child2");
453+ mouseClick(department, 0, 0);
454+ compare(dashDepartments.showList, true);
455+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
456+ tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
457+
458+ var departmentList1 = findChild(dashDepartments, "department1");
459+ allButton = findChild(departmentList1, "allButton");
460+ var backButton = findChild(findChild(departmentList1, "department1"), "backButton");
461+ compare(allButton.visible, true);
462+ compare(backButton.visible, true);
463+
464+ mouseClick(allButton, 0, 0);
465+ compare(dashDepartments.showList, false);
466+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
467+ tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
468+
469+ mouseClick(dashDepartments, 0, 0);
470+ compare(dashDepartments.showList, true);
471+ waitForRendering(departmentListView);
472+ waitForRendering(departmentListView.currentItem);
473+ compare(allButton.visible, true);
474+ compare(backButton.visible, true);
475+
476+ tryCompare(departmentList1.department, "loaded", true);
477+ department = findChild(dashDepartments, "department1child2");
478+ mouseClick(department, 0, 0);
479+ compare(dashDepartments.showList, false);
480+ tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22");
481+ tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
482+
483+ mouseClick(dashDepartments, 0, 0);
484+ compare(dashDepartments.showList, true);
485+ waitForRendering(departmentListView);
486+ waitForRendering(departmentListView.currentItem);
487+
488+ tryCompare(departmentList1.department, "loaded", true);
489+ department = findChild(dashDepartments, "department1child3");
490+ mouseClick(department, 0, 0);
491+ compare(dashDepartments.showList, false);
492+ tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23");
493+ tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
494+
495+ mouseClick(dashDepartments, 0, 0);
496+ compare(dashDepartments.showList, true);
497+ waitForRendering(departmentListView);
498+ waitForRendering(departmentListView.currentItem);
499+ mouseClick(backButton, 0, 0);
500+
501+ tryCompare(dashDepartments.currentDepartment, "departmentId", "root");
502+ tryCompare(departmentListView.currentItem.department, "departmentId", "root");
503+ compare(dashDepartments.showList, true);
504+ mouseClick(dashDepartments, 0, 0);
505+ compare(dashDepartments.showList, false);
506+
507+ mouseClick(dashDepartments, 0, 0);
508+ compare(dashDepartments.showList, true);
509+ tryCompare(departmentListView.currentItem.department, "loaded", true);
510+ department = findChild(dashDepartments, "department0child2");
511+ mouseClick(department, 0, 0);
512+ compare(dashDepartments.showList, true);
513+ departmentList1 = findChild(dashDepartments, "department1");
514+ compare(departmentList1.department.loaded, false);
515+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
516+ allButton = findChild(departmentList1, "allButton");
517+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
518+ mouseClick(allButton, 0, 0);
519+ tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
520+ }
410521 }
411522}