~artmello/ubuntu-ui-extras/ubuntu-ui-extras-fix_1524973

« back to all changes in this revision

Viewing changes to tests/qml/tst_ActionsBar.qml

  • Committer: CI Train Bot
  • Author(s): Arthur Mello
  • Date: 2015-03-11 18:38:00 UTC
  • mfrom: (69.2.7 ubuntu-ui-extras-qmltests)
  • Revision ID: ci-train-bot@canonical.com-20150311183800-8nq0dc8orlvswkrv
Add QML tests to PhotoEditor's components
Approved by: PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2015 Canonical Ltd.
 
3
 *
 
4
 * This file is part of dialer-app.
 
5
 *
 
6
 * dialer-app is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * dialer-app is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.3
 
20
import QtTest 1.0
 
21
import Ubuntu.Test 0.1
 
22
import Ubuntu.Components 1.1
 
23
 
 
24
import '../../modules/Ubuntu/Components/Extras/PhotoEditor'
 
25
 
 
26
Item {
 
27
    id: root
 
28
 
 
29
    width: units.gu(40)
 
30
    height: units.gu(60)
 
31
 
 
32
    property list<Action> toolActions: [
 
33
        Action { text: "ToolActions01" },
 
34
        Action { text: "ToolActions02" }
 
35
    ]
 
36
 
 
37
    property list<Action> filterActions: [
 
38
        Action { text: "FilterActions01" },
 
39
        Action { text: "FilterActions02" }
 
40
    ]
 
41
 
 
42
    ActionsBar {
 
43
        id: actionsBar
 
44
        toolActions: root.toolActions
 
45
    }
 
46
 
 
47
    UbuntuTestCase {
 
48
        id: actionsBarTestCase
 
49
        name: 'actionsBarTestCase'
 
50
        when: windowShown
 
51
 
 
52
        function init() {
 
53
            waitForRendering(actionsBar);
 
54
        }
 
55
 
 
56
        function cleanup() {
 
57
        }
 
58
 
 
59
        function test_actionsBarCheckColumnHeightWhitFilterActions() {
 
60
            actionsBar.filterActions = root.filterActions
 
61
            tryCompare(actionsBar, 'height', units.gu(20))
 
62
        }
 
63
 
 
64
        function test_actionsBarCheckColumnHeightWhitFilterActionsEmpty() {
 
65
            actionsBar.filterActions = []
 
66
            tryCompare(actionsBar, 'height', units.gu(6))
 
67
        }
 
68
 
 
69
        function test_actionsBarCheckFiltersBarVisibleWhitFilterActions() {
 
70
            actionsBar.filterActions = root.filterActions
 
71
            var filtersBar = findChild(actionsBar, 'filtersBar')
 
72
            tryCompare(filtersBar, 'visible', true)
 
73
        }
 
74
 
 
75
        function test_actionsBarCheckFiltersBarNotVisibleWhitFilterActionsEmpty() {
 
76
            actionsBar.filterActions = []
 
77
            var filtersBar = findChild(actionsBar, 'filtersBar')
 
78
            tryCompare(filtersBar, 'visible', false)
 
79
        }
 
80
    }
 
81
}