@@ -98,6 +98,12 @@ Item {
98 name: "AppPreview"
98 name: "AppPreview"
99 when: windowShown
99 when: windowShown
101+ function cleanup() {
102+ sendReviewSpy.clear();
103+ reviewField.focus = false;
104+ reviewField.text = "";
101 function test_actions() {
107 function test_actions() {
102 root.calls = new Array();
108 root.calls = new Array();
103 var buttons = findChild(appPreview, "gridButtons");
109 var buttons = findChild(appPreview, "gridButtons");
@@ -124,20 +130,10 @@ Item {
124 compare(rated.text, i18n.tr("%1 review", "%1 reviews", 8).arg(8), "Reviews don't match");
130 compare(rated.text, i18n.tr("%1 review", "%1 reviews", 8).arg(8), "Reviews don't match");
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");
136 function test_send_review() {
133 function test_send_review() {
137− sendPreviewSpy.clear();
138 var appReviews = findChild(appPreview, "appReviews");
134 var appReviews = findChild(appPreview, "appReviews");
139 appReviews.sendReview("review");
135 appReviews.sendReview("review");
140− compare(sendPreviewSpy.count, 1, "SendReview signal not emitted");
136+ sendPreviewSpy.wait();
143 function test_review_focus() {
139 function test_review_focus() {
@@ -148,6 +144,10 @@ Item {
149 compare(reviewField.focus, false, "ReviewField shouldn't have focus");
145 compare(reviewField.focus, false, "ReviewField shouldn't have focus");
150 compare(appReviews.state, "", "State should be empty");
146 compare(appReviews.state, "", "State should be empty");
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'");
153 function test_comments() {
153 function test_comments() {