@@ -53,7 +53,10 @@ Row {
53 icon: "../graphics/avatars/funky.png",
53 icon: "../graphics/avatars/funky.png",
54 secondaryIcon: "../graphics/applicationIcons/facebook.png",
54 secondaryIcon: "../graphics/applicationIcons/facebook.png",
55 actions: [{ id: "ok_id", label: "Ok"},
55 actions: [{ id: "ok_id", label: "Ok"},
56− { id: "cancel_id", label: "Cancel"}]
56+ { id: "cancel_id", label: "Cancel"},
57+ { id: "notreally_id", label: "Not really"},
58+ { id: "noway_id", label: "No way"},
59+ { id: "nada_id", label: "Nada"}]
59 mockModel.append(n)
62 mockModel.append(n)
@@ -132,7 +135,7 @@ Row {
132 id: interactiveControls
135 id: interactiveControls
134 width: units.gu(30)
137 width: units.gu(30)
135− height: units.gu(71)
138+ height: units.gu(81)
136 color: "grey"
139 color: "grey"
@@ -193,7 +196,10 @@ Row {
193 icon: "../graphics/avatars/funky.png",
196 icon: "../graphics/avatars/funky.png",
194 secondaryIcon: "../graphics/applicationIcons/facebook.png",
197 secondaryIcon: "../graphics/applicationIcons/facebook.png",
195 actions: [{ id: "ok_id", label: "Ok"},
198 actions: [{ id: "ok_id", label: "Ok"},
196− { id: "cancel_id", label: "Cancel"}],
199+ { id: "cancel_id", label: "Cancel"},
200+ { id: "notreally_id", label: "Not really"},
201+ { id: "noway_id", label: "No way"},
202+ { id: "nada_id", label: "Nada"}],
197 summaryVisible: true,
203 summaryVisible: true,
198 bodyVisible: true,
204 bodyVisible: true,
199 interactiveAreaEnabled: false,
205 interactiveAreaEnabled: false,
@@ -299,6 +305,39 @@ Row {
299 actionSpy.clear()
305 actionSpy.clear()
309+ id: timerTestNotificationRenderer
314+ property int hsecond: 0
315+ property bool testPass: false
319+ var heightAfterExpand = notification.height
321+ if(initialHeight < heightAfterExpand) {
323+ verify(testPass = true, "height of expanded snap-decision is not the greater than its initial height")
333+ verify(testPass = true, "height of expanded snap-decision is not the greater than its initial height")
302 function test_NotificationRenderer(data) {
341 function test_NotificationRenderer(data) {
303 // populate model with some mock notifications
342 // populate model with some mock notifications
304 mockModel.append(data)
343 mockModel.append(data)
@@ -341,15 +380,53 @@ Row {
341 var buttonAccept = findChild(buttonRow, "button0")
380 var buttonAccept = findChild(buttonRow, "button0")
343 waitForRendering(notification)
382 waitForRendering(notification)
344− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
346− compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
384+ // only test the left/cancel-button if two actions have been passed in
385+ if (data.actions.length == 2) {
386+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
388+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
392+ // click the positive/right button
349 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
393 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
350 actionSpy.wait()
394 actionSpy.wait()
351 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
395 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
352 actionSpy.clear()
396 actionSpy.clear()
398+ // check if there's more than one negative choice
399+ if (data.actions.length > 2) {
400+ var initialHeight = notification.height
403+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
404+ waitForRendering(notification)
407+ //timerTestNotificationRenderer.start()
409+ // test the additional buttons
410+ for (var i = 2; i < data.actions.length; i++) {
411+ waitForRendering(notification)
412+ var buttonColumn = findChild(notification, "buttonColumn")
413+ var button = findChild(buttonColumn, "button" + i)
415+ mouseClick(button, button.width / 2, button.height / 2)
417+ compare(actionSpy.signalArguments[0][0], data.actions[i]["id"], "got wrong id for additional negative action")
421+ // click to collapse
422+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
423+ waitForRendering(notification)
424+ tryCompare(notification, "height", initialHeight)
426+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
428+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")