on xenial help sign in
Simplify AppPreview tests.
commitce9c47be587e8fd8d3d72e13184dac0a0a0d57af authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 9 Aug 2013, 12:17 (13 years ago) parentce9ef72
1 file changed+13−29
tests/qmltests/Dash/Apps/tst_AppPreview.qml+13−29
tests/qmltests/Dash/Apps/tst_AppPreview.qml+13−29
@@ -33,32 +33,6 @@ Item {
3333 signalName: "sendUserReview"
3434 }
3535
36− function get_actions() {
37− var a1 = new Object();
38− a1.id = 123;
39− a1.displayName = "action1";
40− var a2 = new Object();
41− a2.id = 456;
42− a2.displayName = "action2";
43− var a3 = new Object();
44− a3.id = 789;
45− a3.displayName = "action3";
46−
47− return [a1, a2, a3];
48− }
49−
50− function get_infomap() {
51− var map = {
52− "more-screenshots": screenshots,
53− "rating": rating,
54− "rated": rated,
55− "reviews": reviews,
56− "comments": comments
57− }
58−
59− return map;
60− }
61−
6236 property string commentary: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus a mi vitae augue rhoncus lobortis ut rutrum metus. Curabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.";
6337 QtObject { id: screenshots; property var value: ["fake_image1.png", "fake_image2.png", "fake_image3.png"] }
6438 QtObject { id: rating; property int value: 8 }
@@ -78,8 +52,18 @@ Item {
7852 property string appIcon: "fake_image.png"
7953 property string description: "This is an Application description"
8054 property var execute: root.fake_call
81− property var infoMap: get_infomap()
82− property var actions: get_actions()
55+ property var infoMap: {
56+ "more-screenshots": screenshots,
57+ "rating": rating,
58+ "rated": rated,
59+ "reviews": reviews,
60+ "comments": comments
61+ }
62+ property var actions: [
63+ { "id": 123, "displayName": "action1" },
64+ { "id": 456, "displayName": "action2" },
65+ { "id": 789, "displayName": "action3" },
66+ ]
8367 }
8468
8569 function fake_call(id, data){
@@ -115,7 +99,7 @@ Item {
11599 buttons.currentItem.clicked();
116100 }
117101
118− var actions = get_actions();
102+ var actions = data.actions;
119103 for(var i = 0; i < actions.length; i++) {
120104 compare(root.calls[i], actions[i].id, "Id of action not found.");
121105 }