aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndreas Marek2013-05-06 10:20:15 +0200
committerPete Bacon Darwin2013-05-14 20:50:36 +0100
commit629fb37351ce5778a40a8bc8cd7c1385b382ce75 (patch)
tree4580bd3ea41c0bb492ac58e5f669cd9ecf3d2ce8 /test
parent908821e20af311be905e24639dce273f2ea58434 (diff)
downloadangular.js-629fb37351ce5778a40a8bc8cd7c1385b382ce75.tar.bz2
feat(scenario): adds mousedown and mouseup event triggers to scenario
Added mousedown and mouseup event triggers to scenadio dsl 'element' expression. Added mousedown and mouseup to the custom jquery trigger method to generate real events.
Diffstat (limited to 'test')
-rw-r--r--test/ngScenario/dslSpec.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js
index 28c9ffdc..d89d6ebf 100644
--- a/test/ngScenario/dslSpec.js
+++ b/test/ngScenario/dslSpec.js
@@ -367,6 +367,46 @@ describe("angular.scenario.dsl", function() {
expect(mousedOver).toBe(true);
});
+ it('should execute mousedown', function() {
+ var mousedDown;
+ doc.append('<div></div>');
+ doc.find('div').mousedown(function() {
+ mousedDown = true;
+ });
+ $root.dsl.element('div').mousedown();
+ expect(mousedDown).toBe(true);
+ });
+
+ it('should bubble up the mousedown event', function() {
+ var mousedDown;
+ doc.append('<div id="outer"><div id="inner"></div></div>');
+ doc.find('#outer').mousedown(function() {
+ mousedDown = true;
+ });
+ $root.dsl.element('#inner').mousedown();
+ expect(mousedDown).toBe(true);
+ });
+
+ it('should execute mouseup', function() {
+ var mousedUp;
+ doc.append('<div></div>');
+ doc.find('div').mouseup(function() {
+ mousedUp = true;
+ });
+ $root.dsl.element('div').mouseup();
+ expect(mousedUp).toBe(true);
+ });
+
+ it('should bubble up the mouseup event', function() {
+ var mousedUp;
+ doc.append('<div id="outer"><div id="inner"></div></div>');
+ doc.find('#outer').mouseup(function() {
+ mousedUp = true;
+ });
+ $root.dsl.element('#inner').mouseup();
+ expect(mousedUp).toBe(true);
+ });
+
it('should count matching elements', function() {
doc.append('<span></span><span></span>');
$root.dsl.element('span').count();