@@ -1,5 +1,5 @@
11/*
2− * Copyright 2015 Canonical Ltd.
2+ * Copyright 2015-2016 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -31,21 +31,6 @@ Item {
3131 height: notificationsRect.height
3232 property int index: 0
3333
34− // add the default/PlaceHolder notification to the model
35− Component.onCompleted: {
36− var component = Qt.createComponent("Notification.qml")
37− var n = component.createObject("notification", {"nid": index++,
38− "type": Notification.PlaceHolder,
39− "hints": {},
40− "summary": "",
41− "body": "",
42− "icon": "",
43− "secondaryIcon": "",
44− "rawActions": []})
45− n.completed.connect(mockModel.onCompleted)
46− mockModel.append(n)
47− }
48−
4934 Row {
5035 id: rootRow
5136
@@ -157,15 +142,13 @@ Item {
157142 }
158143
159144 function clearNotifications() {
160− while(mockModel.count > 1) {
161− remove1stNotification()
145+ while(mockModel.count > 0) {
146+ remove1stNotification();
162147 }
163148 }
164149
165150 function remove1stNotification() {
166− if (mockModel.count > 1) {
167− mockModel.removeSecond()
168− }
151+ mockModel.removeFirst();
169152 }
170153
171154 Rectangle {
@@ -791,13 +774,13 @@ Item {
791774 waitForRendering(notifications);
792775
793776 // first one should be expanded by default
794− var notification1 = findChild(notifications, "notification1") // 0 is placeholder...
777+ var notification1 = findChild(notifications, "notification0")
795778 verify(!!notification1, "notification wasn't found");
796779 waitForRendering(notification1);
797780 verify(notification1.expanded);
798781
799782 // click the 2nd one, verify it's now expanded
800− var notification2 = findChild(notifications, "notification2") // 0 is placeholder...
783+ var notification2 = findChild(notifications, "notification1")
801784 verify(!!notification2, "notification wasn't found");
802785 waitForRendering(notification2);
803786 mouseClick(notification2);