@@ -725,6 +725,95 @@ Item {
725 tryCompare(mockModel, "count", before - 1)
725 tryCompare(mockModel, "count", before - 1)
728+ function expansionLogic_data() {
730+ tag: "Snap Decision without secondary icon and no button-tint",
732+ summaryVisible: true,
735+ centeredIconVisible: false,
737+ secondaryIconVisible: false,
738+ buttonRowVisible: true,
739+ buttonTinted: false,
741+ valueVisible: false,
742+ valueLabelVisible: false,
746+ tag: "2-over-1 Snap Decision with button-tint",
748+ summaryVisible: true,
751+ centeredIconVisible: false,
753+ secondaryIconVisible: false,
754+ buttonRowVisible: false,
757+ valueVisible: false,
758+ valueLabelVisible: false,
762+ tag: "Snap Decision without secondary icon and no button-tint",
764+ summaryVisible: true,
767+ centeredIconVisible: false,
769+ secondaryIconVisible: false,
770+ buttonRowVisible: true,
771+ buttonTinted: false,
773+ valueVisible: false,
774+ valueLabelVisible: false,
780+ function test_expansionLogic() {
781+ var data = expansionLogic_data();
784+ data.forEach(function(notification) {
785+ mockModel.append(notification.n);
786+ notification.n.completed.connect(mockModel.onCompleted)
789+ // make sure the view is properly updated before going on
790+ notifications.forceLayout();
791+ waitForRendering(notifications);
793+ // first one should be expanded by default
794+ var notification1 = findChild(notifications, "notification1") // 0 is placeholder...
795+ verify(!!notification1, "notification wasn't found");
796+ waitForRendering(notification1);
797+ verify(notification1.expanded);
799+ // click the 2nd one, verify it's now expanded
800+ var notification2 = findChild(notifications, "notification2") // 0 is placeholder...
801+ verify(!!notification2, "notification wasn't found");
802+ waitForRendering(notification2);
803+ mouseClick(notification2);
804+ verify(notification2.expanded);
805+ verify(!notification1.expanded);
807+ // now close the 2nd one, verify 1st is again expanded, 2nd is gone
808+ var dragStart = notification2.width * 0.25;
809+ var dragEnd = notification2.width;
810+ var dragY = notification2.height / 2;
811+ touchFlick(notification2, dragStart, dragY, dragEnd, dragY);
812+ waitForRendering(notifications);
813+ tryCompareFunction(function() { return notification1.expanded; }, true);
814+ tryCompareFunction(function() { return notification2.expanded; }, undefined);
728 function cleanupTestCase() {
817 function cleanupTestCase() {
729 notifications.hasMouse = false;
818 notifications.hasMouse = false;