@@ -57,6 +57,7 @@ Rectangle {
5757 when: windowShown
5858
5959 function test_triggered() {
60+ waitForRendering(preview);
6061 var widget = findChild(preview, "widget-3");
6162
6263 compare(typeof widget, "object", "Could not find the widget object.");
@@ -73,6 +74,7 @@ Rectangle {
7374 }
7475
7576 function test_showProcessing() {
77+ waitForRendering(preview);
7678 var widget = findChild(preview, "widget-3");
7779 widget.triggered(widget.widgetId, "mockAction", {"mock": "data"});
7880
@@ -84,5 +86,29 @@ Rectangle {
8486
8587 tryCompare(processing, "enabled", false);
8688 }
89+
90+ function test_containOnFocus() {
91+ waitForRendering(preview);
92+ var widget = findChild(preview, "widget-13");
93+
94+ widget.forceActiveFocus();
95+
96+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
97+
98+ tryCompareFunction(function () { return bottomLeft.y <= preview.height }, true);
99+ }
100+
101+ function test_containOnGrow() {
102+ waitForRendering(preview);
103+ var widget = findChild(preview, "widget-13");
104+
105+ widget.forceActiveFocus();
106+ widget.height += 200;
107+
108+ tryCompareFunction(function () {
109+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
110+ return bottomLeft.y <= preview.height
111+ }, true);
112+ }
87113 }
88114}