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 on 2013-04-23

Add test for DashPeople (skeleton).

Preview Diff

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

Subscribers

People subscribed via source and target branches