From: rwldrn Date: Tue, 24 May 2011 15:58:56 +0000 (-0400) Subject: [#540] Adds unit tests for Popcorn.events.getInterface(); X-Git-Tag: v0.7^2~56^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3556086f5ec9d998d3b4071d878ed60f17a43f75;p=popcorn-js.git [#540] Adds unit tests for Popcorn.events.getInterface(); --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 75be1f2..387ccc1 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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" ); }); });