]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#540] Adds unit tests for Popcorn.events.getInterface();
authorrwldrn <waldron.rick@gmail.com>
Tue, 24 May 2011 15:58:56 +0000 (11:58 -0400)
committerrwldrn <waldron.rick@gmail.com>
Tue, 24 May 2011 15:58:56 +0000 (11:58 -0400)
test/popcorn.unit.js

index 75be1f247367afd1dcb30d57d63f9c7dec1c1e77..387ccc1646272d242c9f75e61a451ca589f1ac27 100644 (file)
@@ -583,7 +583,19 @@ test("Can Detect Native event types", function() {
   expect( tests.length );
 
   tests.forEach(function( type, idx ) {
-    equal( Popcorn.events.isNative( type ), expects[ idx ], type + ( expects[ idx ] ? " is " : " is not " ) + "a native valid event" );
+    equal( Popcorn.events.isNative( type ), expects[ idx ], type + ( expects[ idx ] ? " is " : " is not " ) + "a valid native event" );
+  });
+});
+
+test("Determine event api interface", function() {
+
+  var tests = [ "play", "pause", "click", "scroll", "rough loade", "data seek" ],
+      expects = [ "Events", "Events", "MouseEvents", "UIEvents", false, false ];
+
+  expect( tests.length );
+
+  tests.forEach(function( type, idx ) {
+    equal( Popcorn.events.getInterface( type ), expects[ idx ], type + ( expects[ idx ] ? " is " : " is not " ) + "a valid native event" );
   });
 });