~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-yakkety-landing-092

« back to all changes in this revision

Viewing changes to tests/qmltests/Menus/tst_ButtonMenu.qml

  • Committer: Nick Dedekind
  • Date: 2013-10-04 10:04:18 UTC
  • mto: (50.2.3 usc.indicators-tests)
  • mto: This revision was merged to the branch mainline in revision 52.
  • Revision ID: nicholas.dedekind@gmail.com-20131004100418-ddpoed9tc3r25owa
Changes to indicator components to fit into settings

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import QtTest 1.0
21
21
import Ubuntu.Components 0.1
22
22
import Ubuntu.Settings.Menus 0.1
23
 
import "utils.js" as UtilsJS
 
23
import "../utils.js" as UtilsJS
24
24
 
25
25
Item {
26
26
    width: units.gu(42)
33
33
        contentWidth: column.width
34
34
        contentHeight: column.height
35
35
 
36
 
        Column {
 
36
        Item {
37
37
            id: column
38
38
 
39
39
            width: flickable.width
43
43
                id: buttonMenu
44
44
                text: i18n.tr("Button")
45
45
                buttonText: i18n.tr("Hello world!")
 
46
                icon: Qt.resolvedUrl("../../artwork/avatar.png")
 
47
            }
 
48
            ButtonMenu {
 
49
                id: buttonMenu2
 
50
                buttonText: i18n.tr("Button")
 
51
                anchors.top: buttonMenu.bottom
46
52
            }
47
53
        }
48
54
    }
58
64
        when: windowShown
59
65
 
60
66
        function test_click() {
61
 
            signalSpy.clear()
62
 
 
63
 
            var button = UtilsJS.findChild(buttonMenu, "button")
64
 
            mouseClick(buttonMenu, button.width / 2, button.height / 2, Qt.LeftButton, Qt.NoModifier, 0)
65
 
            compare(signalSpy.count > 0, true, "signal clicked not triggered")
 
67
            signalSpy.clear();
 
68
 
 
69
            var button = UtilsJS.findChild(buttonMenu, "button");
 
70
            var button2 = UtilsJS.findChild(buttonMenu2, "button");
 
71
            verify(button !== undefined);
 
72
 
 
73
            mouseClick(button, button.width / 2, button.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
 
74
            compare(signalSpy.count > 0, true, "signal clicked not triggered");
66
75
        }
67
76
    }
68
77
}