diff options
Diffstat (limited to 'tests/auto/controls/data/tst_buttongroup.qml')
-rw-r--r-- | tests/auto/controls/data/tst_buttongroup.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_buttongroup.qml b/tests/auto/controls/data/tst_buttongroup.qml index bb0ffe00..91bc3aa1 100644 --- a/tests/auto/controls/data/tst_buttongroup.qml +++ b/tests/auto/controls/data/tst_buttongroup.qml @@ -65,6 +65,11 @@ TestCase { signalName: "buttonsChanged" } + SignalSpy { + id: clickedSpy + signalName: "clicked" + } + function init() { verify(!checkedButtonSpy.target) compare(checkedButtonSpy.count, 0) @@ -217,6 +222,32 @@ TestCase { group.destroy() } + function test_clicked() { + var group = buttonGroup.createObject(testCase) + verify(group) + + clickedSpy.target = group + verify(clickedSpy.valid) + + var button1 = button.createObject(testCase) + var button2 = button.createObject(testCase) + + group.addButton(button1) + group.addButton(button2) + + button1.clicked() + compare(clickedSpy.count, 1) + compare(clickedSpy.signalArguments[0][0], button1) + + button2.clicked() + compare(clickedSpy.count, 2) + compare(clickedSpy.signalArguments[1][0], button2) + + group.destroy() + button1.destroy() + button2.destroy() + } + Component { id: checkBoxes Item { |