summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-12-15 14:25:15 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-12-15 15:00:28 +1000
commit81e09bb0d7bb5b8ce58773f5e9422b3c507006dd (patch)
treeaf445e8a92501be178b02fa0d9724ee58ee2b147 /tests
parent6259fd7b01373fdcfb8f5e9e4a7487c0002189a3 (diff)
Add a SignalSpy item for watching signals
Diffstat (limited to 'tests')
-rw-r--r--tests/qmlauto/buttonclick/tst_buttonclick.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/qmlauto/buttonclick/tst_buttonclick.qml b/tests/qmlauto/buttonclick/tst_buttonclick.qml
index 2fb13f7..907b442 100644
--- a/tests/qmlauto/buttonclick/tst_buttonclick.qml
+++ b/tests/qmlauto/buttonclick/tst_buttonclick.qml
@@ -45,13 +45,22 @@ import QtQuickTest 1.0
Button {
id: button
onClicked: text = "Clicked"
+
+ SignalSpy {
+ id: spy
+ target: button
+ signalName: "clicked"
+ }
+
TestCase {
name: "ButtonClick"
when: windowShown
function test_click() {
+ compare(spy.count, 0)
button.clicked();
compare(button.text, "Clicked");
+ compare(spy.count, 1)
}
}
}