on xenial help sign in
test for the last leaf fix
48ca58bAlbert Astals
tests/mocks/Unity/fake_department.cpp+1−1
@@ -81,7 +81,7 @@ bool Department::isRoot() const
81
81
82int Department::rowCount(const QModelIndex & /*parent*/) const
82int Department::rowCount(const QModelIndex & /*parent*/) const
83{
83{
84− if (m_departmentId.startsWith("child") || m_departmentId == "middle3")
84+ if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3")
85 return 0;
85 return 0;
86 else
86 else
87 return 8;
87 return 8;
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -503,6 +503,20 @@ Item {
503 compare(dashDepartments.showList, true);
503 compare(dashDepartments.showList, true);
504 mouseClick(dashDepartments, 0, 0);
504 mouseClick(dashDepartments, 0, 0);
505 compare(dashDepartments.showList, false);
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");
506 }
520 }
507 }
521 }
508}
522}