@@ -20,17 +20,34 @@ import ".."
20import "../../../Notifications"
20import "../../../Notifications"
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import Unity.Test 0.1
22import Unity.Test 0.1
23+import Unity.Notifications 1.0
25 id: rootRow
26 id: rootRow
32+ function invokeAction(actionId) {
33+ mockModel.actionInvoked(actionId)
27 ListModel {
38 ListModel {
28 id: mockModel
39 id: mockModel
41+ signal actionInvoked(string actionId)
43+ function getRaw(id) {
44+ return mockNotification.createObject(mockModel)
31 function addSnapDecisionNotification() {
48 function addSnapDecisionNotification() {
33− type: "Notifications.Type.SnapDecision",
50+ type: Notification.SnapDecision,
34 summary: "Tom Ato",
51 summary: "Tom Ato",
35 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
52 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
36 icon: "../graphics/avatars/funky.png",
53 icon: "../graphics/avatars/funky.png",
@@ -44,7 +61,7 @@ Row {
45 function addEphemeralNotification() {
62 function addEphemeralNotification() {
47− type: "Notifications.Type.Ephemeral",
64+ type: Notification.Ephemeral,
48 summary: "Cole Raby",
65 summary: "Cole Raby",
49 body: "I did not expect it to be that late.",
66 body: "I did not expect it to be that late.",
50 icon: "../graphics/avatars/amanda.png",
67 icon: "../graphics/avatars/amanda.png",
@@ -57,7 +74,7 @@ Row {
58 function addEphemeralIconSummaryNotification() {
75 function addEphemeralIconSummaryNotification() {
60− type: "Notifications.Type.Ephemeral",
77+ type: Notification.Ephemeral,
61 summary: "Photo upload completed",
78 summary: "Photo upload completed",
@@ -70,7 +87,7 @@ Row {
71 function addInteractiveNotification() {
88 function addInteractiveNotification() {
73− type: "Notifications.Type.Interactive",
90+ type: Notification.Interactive,
74 summary: "Interactive notification",
91 summary: "Interactive notification",
75 body: "This is a notification that can be clicked",
92 body: "This is a notification that can be clicked",
76 icon: "../graphics/avatars/anna_olsson.png",
93 icon: "../graphics/avatars/anna_olsson.png",
@@ -170,7 +187,7 @@ Row {
172 tag: "Snap Decision with secondary icon",
189 tag: "Snap Decision with secondary icon",
173− type: "Notifications.Type.SnapDecision",
190+ type: Notification.SnapDecision,
174 summary: "Tom Ato",
191 summary: "Tom Ato",
175 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
192 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
176 icon: "../graphics/avatars/funky.png",
193 icon: "../graphics/avatars/funky.png",
@@ -186,7 +203,7 @@ Row {
188 tag: "Ephemeral notification - icon-summary layout",
205 tag: "Ephemeral notification - icon-summary layout",
189− type: "Notifications.Type.Ephemeral",
206+ type: Notification.Ephemeral,
190 summary: "Photo upload completed",
207 summary: "Photo upload completed",
191 body: "",
208 body: "",
192 icon: "",
209 icon: "",
@@ -201,7 +218,7 @@ Row {
203 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
220 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
204− type: "Notifications.Type.Ephemeral",
221+ type: Notification.Ephemeral,
205 summary: "New comment successfully published",
222 summary: "New comment successfully published",
206 body: "",
223 body: "",
207 icon: "",
224 icon: "",
@@ -216,7 +233,7 @@ Row {
218 tag: "Interactive notification",
235 tag: "Interactive notification",
219− type: "Notifications.Type.Interactive",
236+ type: Notification.Interactive,
220 summary: "Interactive notification",
237 summary: "Interactive notification",
221 body: "This is a notification that can be clicked",
238 body: "This is a notification that can be clicked",
222 icon: "../graphics/avatars/amanda.png",
239 icon: "../graphics/avatars/amanda.png",
@@ -231,7 +248,7 @@ Row {
233 tag: "Snap Decision without secondary icon",
250 tag: "Snap Decision without secondary icon",
234− type: "Notifications.Type.SnapDecision",
251+ type: Notification.SnapDecision,
235 summary: "Bro Coly",
252 summary: "Bro Coly",
236 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
253 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
237 icon: "../graphics/avatars/anna_olsson.png",
254 icon: "../graphics/avatars/anna_olsson.png",
@@ -247,7 +264,7 @@ Row {
249 tag: "Ephemeral notification",
266 tag: "Ephemeral notification",
250− type: "Notifications.Type.Ephemeral",
267+ type: Notification.Ephemeral,
251 summary: "Cole Raby",
268 summary: "Cole Raby",
252 body: "I did not expect it to be that late.",
269 body: "I did not expect it to be that late.",
253 icon: "../graphics/avatars/funky.png",
270 icon: "../graphics/avatars/funky.png",
@@ -272,6 +289,8 @@ Row {
273 SignalSpy {
290 SignalSpy {
274 id: actionSpy
291 id: actionSpy
275 signalName: "actionInvoked"
294 signalName: "actionInvoked"
@@ -303,7 +322,6 @@ Row {
303 compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
322 compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
305 if(data.interactiveAreaEnabled) {
324 if(data.interactiveAreaEnabled) {
306− actionSpy.target = notification
307 mouseClick(notification, notification.width / 2, notification.height / 2)
325 mouseClick(notification, notification.width / 2, notification.height / 2)
308 actionSpy.wait()
326 actionSpy.wait()
309 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
327 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -323,7 +341,6 @@ Row {
323 var buttonAccept = findChild(buttonRow, "button0")
341 var buttonAccept = findChild(buttonRow, "button0")
325 waitForRendering(notification)
343 waitForRendering(notification)
326− actionSpy.target = notification
327 mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
344 mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
328 actionSpy.wait()
345 actionSpy.wait()
329 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
346 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
@@ -332,6 +349,7 @@ Row {
332 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
349 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
333 actionSpy.wait()
350 actionSpy.wait()
334 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
351 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")