** Description changed:

  Execute the code below using qmltestrunner, and the test will fail
  because 'count' is 2, not 1.
  
  import QtTest 1.0
  import QtQuick 2.4
  import Ubuntu.Components 1.3
  import Ubuntu.Test 1.3
  
  Item {
-     id: root
-     width: units.gu(50)
-     height: units.gu(80)
+     id: root
+     width: units.gu(50)
+     height: units.gu(80)
  
-     Button {
-         id: button
-         anchors.centerIn: parent
-         text: "Click me"
-         onClicked: {
-             print("click")
-         }
-     }
+     Button {
+         id: button
+         anchors.centerIn: parent
+         text: "Click me"
+         onClicked: {
+             print("click")
+         }
+     }
  
-     TestCase {
-         name: "ButtonClickedSpy"
-         when: windowShown
-         id: testCase
+     TestCase {
+         name: "ButtonClickedSpy"
+         when: windowShown
+         id: testCase
  
-         SignalSpy {
-             id: buttonSpy
-             signalName: 'clicked'
-             target: button
-             onCountChanged: print("new count = "+count)
-         }
+         SignalSpy {
+             id: buttonSpy
+             signalName: 'clicked'
+             target: button
+             onCountChanged: print("new count = "+count)
+         }
  
-         function test_click_button() {
-             buttonSpy.clear();
-             print("spy count after clearing = "+buttonSpy.count);
-             mouseClick(button);
-             compare(buttonSpy.count, 1, "Could not click button.");
-         }
-     }
+         function test_click_button() {
+             buttonSpy.clear();
+             print("spy count after clearing = "+buttonSpy.count);
+             mouseClick(button);
+             compare(buttonSpy.count, 1, "Could not click button.");
+         }
+     }
  }
+ 
+ 
+ Test results here: http://pastebin.ubuntu.com/15791843/

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1569379

Title:
  SignalSpy records TWO clicks when clicking on a Button ONCE.

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  Execute the code below using qmltestrunner, and the test will fail
  because 'count' is 2, not 1.

  import QtTest 1.0
  import QtQuick 2.4
  import Ubuntu.Components 1.3
  import Ubuntu.Test 1.3

  Item {
      id: root
      width: units.gu(50)
      height: units.gu(80)

      Button {
          id: button
          anchors.centerIn: parent
          text: "Click me"
          onClicked: {
              print("click")
          }
      }

      TestCase {
          name: "ButtonClickedSpy"
          when: windowShown
          id: testCase

          SignalSpy {
              id: buttonSpy
              signalName: 'clicked'
              target: button
              onCountChanged: print("new count = "+count)
          }

          function test_click_button() {
              buttonSpy.clear();
              print("spy count after clearing = "+buttonSpy.count);
              mouseClick(button);
              compare(buttonSpy.count, 1, "Could not click button.");
          }
      }
  }

  
  Test results here: http://pastebin.ubuntu.com/15791843/

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1569379/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to