SignalSpy {
id: animationStartedSpy
signalName: "started"
}
function test_press_release_on_different_icons() {
var leftIcon = findChild(scrollingSections, "left_scroll_icon");
var rightIcon = findChild(scrollingSections, "right_scroll_icon");
var animation = findChild(scrollingSections, "sections_scroll_animation");
animationStartedSpy.target = animation;
compare(leftIcon.width, rightIcon.width, "Scroll icons are not the same width.");
compare(leftIcon.height, rightIcon.height, "Scroll icons are not the same height.");
var w = leftIcon.width / 2;
var h = leftIcon.height / 2;
mouseMove(leftIcon, w, h);
mousePress(leftIcon, w, h);
mouseMove(rightIcon, w, h);
mouseRelease(rightIcon, w, h);
wait(200);
compare(animationStartedSpy.count, 0,
"Clicked signal came after pressing left icon and releasing on right icon.");
mousePress(rightIcon, w, h);
mouseMove(leftIcon, w, h);
mouseRelease(leftIcon, w, h);
wait(200);
compare(animationStartedSpy.count, 0,
"Clicked signal came after pressing right icon and releasing on left icon.");
animationStartedSpy.target = null;
}