@@ -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,
@@ -341,15 +347,50 @@ Row {
341 var buttonAccept = findChild(buttonRow, "button0")
347 var buttonAccept = findChild(buttonRow, "button0")
343 waitForRendering(notification)
349 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")
351+ // only test the left/cancel-button if two actions have been passed in
352+ if (data.actions.length == 2) {
353+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
355+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
359+ // click the positive/right button
349 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
360 mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2)
350 actionSpy.wait()
361 actionSpy.wait()
351 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
362 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
352 actionSpy.clear()
363 actionSpy.clear()
365+ // check if there's more than one negative choice
366+ if (data.actions.length > 2) {
367+ var initialHeight = notification.height
370+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
371+ waitForRendering(notification)
374+ // test the additional buttons
375+ for (var i = 2; i < data.actions.length; i++) {
376+ waitForRendering(notification)
377+ var buttonColumn = findChild(notification, "buttonColumn")
378+ var button = findChild(buttonColumn, "button" + i)
379+ mouseClick(button, button.width / 2, button.height / 2)
381+ compare(actionSpy.signalArguments[0][0], data.actions[i]["id"], "got wrong id for additional negative action")
385+ // click to collapse
386+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
387+ waitForRendering(notification)
388+ tryCompare(notification, "height", initialHeight)
390+ mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
392+ compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")