@@ -689,12 +689,15 @@ Item {
692− function test_clickToClose_data() { // reuse the data
692+ function test_closeButton_data() { // reuse the data
693 notifications.hasMouse = true;
693 notifications.hasMouse = true;
694 return test_NotificationRenderer_data();
694 return test_NotificationRenderer_data();
697− function test_clickToClose(data) {
697+ function test_closeButton(data) {
698+ // hook up notification's completed-signal with model's onCompleted-slot, so that remove() (model) happens on close() (notification)
699+ data.n.completed.connect(mockModel.onCompleted)
698 // populate model with some mock notifications
701 // populate model with some mock notifications
699 mockModel.append(data.n)
702 mockModel.append(data.n)
@@ -703,21 +706,18 @@ Item {
703 waitForRendering(notifications);
706 waitForRendering(notifications);
705 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
708 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
709+ waitForRendering(notification);
706 verify(!!notification, "notification wasn't found");
710 verify(!!notification, "notification wasn't found");
708− // click-to-dismiss check
712+ // close button check
709− waitForRendering(notification);
713+ mouseMove(notification, notification.width/2, notification.height/2);
714+ var closeButton = findChild(notification, "closeButton");
715+ tryCompare(closeButton, "visible", true);
710 var before = mockModel.count;
716 var before = mockModel.count;
711− var canBeClosed = notification.canBeClosed;
712− mouseClick(notification);
717+ mouseClick(closeButton);
715− // closing the notification, the model count should be one less
719+ // closing the notification, the model count should be one less
716− tryCompare(mockModel, "count", before - 1)
720+ tryCompare(mockModel, "count", before - 1)
718− // not closing, model stays the same
719− tryCompare(mockModel, "count", before)
723 function cleanupTestCase() {
723 function cleanupTestCase() {