Merge lp:~paulliu/unity/dash_people_test into lp:unity/phablet

Proposed by Ying-Chun Liu
Status: Work in progress
Proposed branch: lp:~paulliu/unity/dash_people_test
Merge into: lp:unity/phablet
Diff against target: 94 lines (+79/-0)
2 files modified
tests/qmltests/CMakeLists.txt (+1/-0)
tests/qmltests/Dash/tst_DashPeople.qml (+78/-0)
To merge this branch: bzr merge lp:~paulliu/unity/dash_people_test
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+160366@code.launchpad.net

Description of the change

Review only. Please don't approve it right now.

To post a comment you must log in.

Unmerged revisions

621. By Ying-Chun Liu

Add test for DashPeople (skeleton).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/CMakeLists.txt'
2--- tests/qmltests/CMakeLists.txt 2013-04-22 18:56:16 +0000
3+++ tests/qmltests/CMakeLists.txt 2013-04-23 13:32:47 +0000
4@@ -42,6 +42,7 @@
5 add_qml_test(Components Tile)
6 add_qml_test(Components PageHeader)
7 add_qml_test(Dash DashPreview)
8+add_qml_test(Dash DashPeople IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/mocks ${CMAKE_CURRENT_SOURCE_DIR}/plugins ${CMAKE_CURRENT_SOURCE_DIR}/plugins/Unity)
9 add_qml_test(Dash PeoplePreview)
10 add_qml_test(Dash FilterGrids IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_SOURCE_DIR}/plugins)
11 add_qml_test(Dash/Apps RunningApplicationsGrid IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
12
13=== added file 'tests/qmltests/Dash/tst_DashPeople.qml'
14--- tests/qmltests/Dash/tst_DashPeople.qml 1970-01-01 00:00:00 +0000
15+++ tests/qmltests/Dash/tst_DashPeople.qml 2013-04-23 13:32:47 +0000
16@@ -0,0 +1,78 @@
17+/*
18+ * Copyright 2013 Canonical Ltd.
19+ *
20+ * This program is free software; you can redistribute it and/or modify
21+ * it under the terms of the GNU General Public License as published by
22+ * the Free Software Foundation; version 3.
23+ *
24+ * This program is distributed in the hope that it will be useful,
25+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
26+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+ * GNU General Public License for more details.
28+ *
29+ * You should have received a copy of the GNU General Public License
30+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
31+ */
32+
33+import QtQuick 2.0
34+import QtTest 1.0
35+import ".."
36+import "../../../Dash"
37+import Ubuntu.Components 0.1
38+import Unity.Test 0.1 as UT
39+
40+Item {
41+ id: root
42+ width: units.gu(120)
43+ height: units.gu(80)
44+
45+ property bool helper: false
46+
47+ DashPeople {
48+ id: dashPeople
49+ anchors.fill: parent
50+ }
51+
52+ ListModel {
53+ id: mockModel
54+ }
55+
56+ UT.UnityTestCase {
57+ id: testCase
58+ name: "DashPreview"
59+ when: windowShown
60+
61+ function fillModel(data) {
62+ mockModel.clear();
63+ mockModel.append(data);
64+ }
65+
66+ function test_stuff_data() {
67+ return [
68+ {
69+ uri: "contact://1srih4i12312315dsd",
70+ avatar: "../../graphics/clock.png",
71+ category: 0,
72+ mime: "application/contact",
73+ displayName: "Anthony Dillon",
74+ comments: "very busy",
75+ dnd: ""
76+ },
77+ {
78+ uri: "contact://3aih3iohio2hioh3i",
79+ avatar: "../../graphics/clock.png",
80+ category: 0,
81+ mime: "application/contact",
82+ displayName: "Blue Post",
83+ comments: "Inside something",
84+ dnd: ""
85+ },
86+ ]
87+ }
88+
89+ function test_stuff(data) {
90+ fillModel(data)
91+
92+ }
93+ }
94+}

Subscribers

People subscribed via source and target branches