@@ -72,29 +72,29 @@ Item {
72 name: "AppReviews"
72 name: "AppReviews"
73 when: windowShown
73 when: windowShown
75− function test_state_nothing() {
75+ function cleanup() {
76− appReviews.state = "";
76+ sendReviewSpy.clear();
77 var reviewField = findChild(appReviews, "reviewField");
77 var reviewField = findChild(appReviews, "reviewField");
78− var sendButton = findChild(appReviews, "sendButton");
78+ reviewField.focus = false;
79− compare(reviewField.width, appReviews.width, "ReviewField width don't match");
79+ reviewField.text = "";
80− compare(sendButton.opacity, 0, "SendButton opacity should be 0");
83 function test_send_review() {
82 function test_send_review() {
84− sendReviewSpy.clear();
85 var sendButton = findChild(appReviews, "sendButton");
83 var sendButton = findChild(appReviews, "sendButton");
86 mouseClick(sendButton, 1, 1);
84 mouseClick(sendButton, 1, 1);
87− compare(sendReviewSpy.count, 1, "SendReview signal not emitted");
85+ sendReviewSpy.wait();
90 function test_review_focus() {
88 function test_review_focus() {
91− sendReviewSpy.clear();
92 var sendButton = findChild(appReviews, "sendButton");
89 var sendButton = findChild(appReviews, "sendButton");
93 var reviewField = findChild(appReviews, "reviewField");
90 var reviewField = findChild(appReviews, "reviewField");
94− var animation = findChild(appReviews, "editingAnimation");
96 compare(reviewField.focus, false, "ReviewField shouldn't have focus");
92 compare(reviewField.focus, false, "ReviewField shouldn't have focus");
97 compare(appReviews.state, "", "State should be empty");
93 compare(appReviews.state, "", "State should be empty");
95+ mouseClick(reviewField, reviewField.width/2, reviewField.height/2);
96+ compare(reviewField.focus, true, "Review Field should have focus");
97+ compare(appReviews.state, "editing", "State should be 'editing'");
100 function test_comments() {
100 function test_comments() {