@@ -53,7 +53,10 @@ Row {
5353 icon: "../graphics/avatars/funky.png",
5454 secondaryIcon: "../graphics/applicationIcons/facebook.png",
5555 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"}]
5760 }
5861
5962 mockModel.append(n)
@@ -132,7 +135,7 @@ Row {
132135 id: interactiveControls
133136
134137 width: units.gu(30)
135− height: units.gu(71)
138+ height: units.gu(81)
136139 color: "grey"
137140
138141 Column {
@@ -193,7 +196,10 @@ Row {
193196 icon: "../graphics/avatars/funky.png",
194197 secondaryIcon: "../graphics/applicationIcons/facebook.png",
195198 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"}],
197203 summaryVisible: true,
198204 bodyVisible: true,
199205 interactiveAreaEnabled: false,
@@ -299,6 +305,39 @@ Row {
299305 actionSpy.clear()
300306 }
301307
308+ /*Timer {
309+ id: timerTestNotificationRenderer
310+
311+ interval: 100
312+ repeat: true
313+ running: true
314+ property int hsecond: 0
315+ property bool testPass: false
316+ onTriggered: {
317+
318+ try {
319+ var heightAfterExpand = notification.height
320+
321+ if(initialHeight < heightAfterExpand) {
322+ testPass: true
323+ verify(testPass = true, "height of expanded snap-decision is not the greater than its initial height")
324+ stop()
325+ }
326+ }
327+ catch(err) {
328+ // do nothing
329+ }
330+
331+ // wait 2 seconds
332+ if(hsecond > 20) {
333+ verify(testPass = true, "height of expanded snap-decision is not the greater than its initial height")
334+ stop()
335+ }
336+
337+ hsecond++
338+ }
339+ }*/
340+
302341 function test_NotificationRenderer(data) {
303342 // populate model with some mock notifications
304343 mockModel.append(data)
@@ -341,15 +380,53 @@ Row {
341380 var buttonAccept = findChild(buttonRow, "button0")
342381
343382 waitForRendering(notification)
344− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
345− actionSpy.wait()
346− compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
347− actionSpy.clear()
348383
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)
387+ actionSpy.wait()
388+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
389+ actionSpy.clear()
390+ }
391+
392+ // click the positive/right button
349393 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
350394 actionSpy.wait()
351395 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
352396 actionSpy.clear()
397+
398+ // check if there's more than one negative choice
399+ if (data.actions.length > 2) {
400+ var initialHeight = notification.height
401+
402+ // click to expand
403+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
404+ waitForRendering(notification)
405+ actionSpy.clear()
406+
407+ //timerTestNotificationRenderer.start()
408+
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)
414+
415+ mouseClick(button, button.width / 2, button.height / 2)
416+ actionSpy.wait()
417+ compare(actionSpy.signalArguments[0][0], data.actions[i]["id"], "got wrong id for additional negative action")
418+ actionSpy.clear()
419+ }
420+
421+ // click to collapse
422+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
423+ waitForRendering(notification)
424+ tryCompare(notification, "height", initialHeight)
425+ } else {
426+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
427+ actionSpy.wait()
428+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
429+ }
353430 }
354431 }
355432 }