on xenial help sign in
Removing Rates and Comments section from the UI until the feature is ready
commit0eb380d788aa5c84493337176d9a69bd7804e7bc authorDiego Sarmentero <diego.sarmentero@gmail.com> dateTue 17 Sep 2013, 11:15 (13 years ago) parentd1296e3
2 files changed+57−54
Dash/Apps/AppPreview.qml+7−6 tests/qmltests/Dash/Apps/tst_AppPreview.qml+50−48
Dash/Apps/AppPreview.qml+7−6
@@ -186,14 +186,15 @@ DashPreview {
186186
187187 ListItem.ThinDivider { }
188188
189− AppReviews {
190− objectName: "appReviews"
191− anchors { left: parent.left; right: parent.right }
189+ // TODO: This should be added when the feature for reviews/comments is complete.
190+// AppReviews {
191+// objectName: "appReviews"
192+// anchors { left: parent.left; right: parent.right }
192193
193− model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
194+// model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
194195
195− onSendReview: root.sendUserReview(review);
196− }
196+// onSendReview: root.sendUserReview(review);
197+// }
197198 }
198199 }
199200}
tests/qmltests/Dash/Apps/tst_AppPreview.qml+50−48
@@ -85,9 +85,10 @@ Item {
8585 function cleanup() {
8686 root.calls = new Array();
8787 sendPreviewSpy.clear();
88− var reviewField = findChild(appPreview, "reviewField");
89− reviewField.focus = false;
90− reviewField.text = "";
88+ // TODO: This should be added when the feature for reviews/comments is complete.
89+// var reviewField = findChild(appPreview, "reviewField");
90+// reviewField.focus = false;
91+// reviewField.text = "";
9192 data.rating = rating.value;
9293 }
9394
@@ -116,51 +117,52 @@ Item {
116117 compare(rated.text, "8 reviews", "Reviews don't match");
117118 }
118119
119− function test_send_review() {
120− var appReviews = findChild(appPreview, "appReviews");
121− appReviews.sendReview("review");
122− sendPreviewSpy.wait();
123− }
124−
125− function test_review_focus() {
126− var appReviews = findChild(appPreview, "appReviews");
127− var sendButton = findChild(appReviews, "sendButton");
128− var reviewField = findChild(appReviews, "reviewField");
129−
130− compare(reviewField.focus, false, "ReviewField shouldn't have focus");
131− compare(appReviews.state, "", "State should be empty");
132−
133− mouseClick(reviewField, reviewField.width/2, reviewField.height/2);
134− compare(reviewField.focus, true, "Review Field should have focus");
135− compare(appReviews.state, "editing", "State should be 'editing'");
136− }
137−
138− function test_comments() {
139− var commentsArea = findChild(appPreview, "commentsArea");
140− compare(commentsArea.count, 3);
141− for(var i = 0; i < 3; i++) {
142− var username = commentsArea.itemAt(i).children[0].children[0].text
143− var rate = commentsArea.itemAt(i).children[0].children[1].children[0].rating
144− var date = commentsArea.itemAt(i).children[0].children[1].children[1].text
145− var comment = commentsArea.itemAt(i).children[1].text
146− compare(username, comments.value[i][0], "Username don't match");
147− compare(rate, comments.value[i][1], "Rating don't match");
148− compare(date, comments.value[i][2], "Date don't match");
149− compare(comment, comments.value[i][3], "Comment don't match");
150− }
151− }
152−
153− function test_negative_rating() {
154− data.rating = -1.0;
155− var rated = findChild(appPreview, "reviewsLabel");
156− verify(rated.visible == false);
157− var commentsArea = findChild(appPreview, "commentsArea");
158− verify(commentsArea.visible == false);
159− var appReviews = findChild(appPreview, "appReviews");
160− verify(appReviews.visible == false);
161− var buttons = findChild(appPreview, "gridButtons");
162− verify(buttons.visible == true);
163− }
120+ // TODO: This should be added when the feature for reviews/comments is complete.
121+// function test_send_review() {
122+// var appReviews = findChild(appPreview, "appReviews");
123+// appReviews.sendReview("review");
124+// sendPreviewSpy.wait();
125+// }
126+
127+// function test_review_focus() {
128+// var appReviews = findChild(appPreview, "appReviews");
129+// var sendButton = findChild(appReviews, "sendButton");
130+// var reviewField = findChild(appReviews, "reviewField");
131+
132+// compare(reviewField.focus, false, "ReviewField shouldn't have focus");
133+// compare(appReviews.state, "", "State should be empty");
134+
135+// mouseClick(reviewField, reviewField.width/2, reviewField.height/2);
136+// compare(reviewField.focus, true, "Review Field should have focus");
137+// compare(appReviews.state, "editing", "State should be 'editing'");
138+// }
139+
140+// function test_comments() {
141+// var commentsArea = findChild(appPreview, "commentsArea");
142+// compare(commentsArea.count, 3);
143+// for(var i = 0; i < 3; i++) {
144+// var username = commentsArea.itemAt(i).children[0].children[0].text
145+// var rate = commentsArea.itemAt(i).children[0].children[1].children[0].rating
146+// var date = commentsArea.itemAt(i).children[0].children[1].children[1].text
147+// var comment = commentsArea.itemAt(i).children[1].text
148+// compare(username, comments.value[i][0], "Username don't match");
149+// compare(rate, comments.value[i][1], "Rating don't match");
150+// compare(date, comments.value[i][2], "Date don't match");
151+// compare(comment, comments.value[i][3], "Comment don't match");
152+// }
153+// }
154+
155+// function test_negative_rating() {
156+// data.rating = -1.0;
157+// var rated = findChild(appPreview, "reviewsLabel");
158+// verify(rated.visible == false);
159+// var commentsArea = findChild(appPreview, "commentsArea");
160+// verify(commentsArea.visible == false);
161+// var appReviews = findChild(appPreview, "appReviews");
162+// verify(appReviews.visible == false);
163+// var buttons = findChild(appPreview, "gridButtons");
164+// verify(buttons.visible == true);
165+// }
164166
165167 }
166168}