on xenial help sign in
test for the last leaf fix
commit48ca58b60abd79d0f334e57a29bae110039f25c0 authorAlbert Astals <albert.astals@canonical.com> dateWed 18 Jun 2014, 15:48 (12 years ago) parentbc931ca
2 files changed+15−1
tests/mocks/Unity/fake_department.cpp+1−1 tests/qmltests/Dash/tst_DashContent.qml+14
tests/mocks/Unity/fake_department.cpp+1−1
@@ -81,7 +81,7 @@ bool Department::isRoot() const
8181
8282int Department::rowCount(const QModelIndex & /*parent*/) const
8383{
84− if (m_departmentId.startsWith("child") || m_departmentId == "middle3")
84+ if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3")
8585 return 0;
8686 else
8787 return 8;
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -503,6 +503,20 @@ Item {
503503 compare(dashDepartments.showList, true);
504504 mouseClick(dashDepartments, 0, 0);
505505 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");
506520 }
507521 }
508522}