@@ -98,6 +98,12 @@ Item {
9898 name: "AppPreview"
9999 when: windowShown
100100
101+ function cleanup() {
102+ sendReviewSpy.clear();
103+ reviewField.focus = false;
104+ reviewField.text = "";
105+ }
106+
101107 function test_actions() {
102108 root.calls = new Array();
103109 var buttons = findChild(appPreview, "gridButtons");
@@ -124,20 +130,10 @@ Item {
124130 compare(rated.text, i18n.tr("%1 review", "%1 reviews", 8).arg(8), "Reviews don't match");
125131 }
126132
127− function test_state_nothing() {
128− var appReviews = findChild(appPreview, "appReviews");
129− appReviews.state = "";
130− var reviewField = findChild(appPreview, "reviewField");
131− var sendButton = findChild(appPreview, "sendButton");
132− compare(reviewField.width, appReviews.width, "ReviewField width don't match");
133− compare(sendButton.opacity, 0, "SendButton opacity should be 0");
134− }
135−
136133 function test_send_review() {
137− sendPreviewSpy.clear();
138134 var appReviews = findChild(appPreview, "appReviews");
139135 appReviews.sendReview("review");
140− compare(sendPreviewSpy.count, 1, "SendReview signal not emitted");
136+ sendPreviewSpy.wait();
141137 }
142138
143139 function test_review_focus() {
@@ -148,6 +144,10 @@ Item {
148144
149145 compare(reviewField.focus, false, "ReviewField shouldn't have focus");
150146 compare(appReviews.state, "", "State should be empty");
147+
148+ mouseClick(reviewField, reviewField.width/2, reviewField.height/2);
149+ compare(reviewField.focus, true, "Review Field should have focus");
150+ compare(appReviews.state, "editing", "State should be 'editing'");
151151 }
152152
153153 function test_comments() {