@@ -25,6 +25,9 @@ Item {
2525 width: units.gu(60)
2626 height: units.gu(80)
2727
28+ // Fake shell
29+ QtObject { id: shell; property int height: appPreview.height }
30+
2831 property var calls: []
2932
3033 SignalSpy {
@@ -114,6 +117,9 @@ Item {
114117 reviewField.text = "";
115118 data.rating = rating.value;
116119 dataProgress.infoMap["progressbar_source"].value = "service";
120+ var appReviews = findChild(appPreview, "appReviews");
121+ appReviews.visible = false;
122+ appPreview.keyboardSize = 0;
117123 }
118124
119125 function test_actions() {
@@ -149,6 +155,7 @@ Item {
149155
150156 function test_review_focus() {
151157 var appReviews = findChild(appPreview, "appReviews");
158+ appReviews.visible = true;
152159 var sendButton = findChild(appReviews, "sendButton");
153160 var reviewField = findChild(appReviews, "reviewField");
154161
@@ -213,5 +220,20 @@ Item {
213220 compare(root.calls[0][1], {"error": "DOWNLOAD ERROR"}, "Data of action not found.");
214221 }
215222
223+ function test_automatic_scroll_on_keyboard_shown() {
224+ waitForRendering(appPreview);
225+ var appReviews = findChild(appPreview, "appReviews");
226+ appReviews.visible = true;
227+
228+ var leftFlickable = findChild(appPreview, "leftFlickable");
229+ leftFlickable.contentY = leftFlickable.contentHeight;
230+ var reviewField = findChild(appReviews, "reviewField");
231+ appPreview.keyboardSize = 400;
232+ appReviews.editing(reviewField);
233+ var newFlickPos = leftFlickable.contentY;
234+ var keyboardY = shell.height - appPreview.keyboardSize;
235+ verify(newFlickPos < keyboardY);
236+ }
237+
216238 }
217239}