From d9c14a296c4fe3767aa4a2514ed94ea2c342bb84 Mon Sep 17 00:00:00 2001 From: Matthew Schranz Date: Fri, 23 Sep 2011 15:30:39 -0400 Subject: [PATCH] [#733] Added Test for Empty Block in Facebook Plugin --- plugins/facebook/popcorn.facebook.unit.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/facebook/popcorn.facebook.unit.js b/plugins/facebook/popcorn.facebook.unit.js index 84fd584..1e01cf9 100755 --- a/plugins/facebook/popcorn.facebook.unit.js +++ b/plugins/facebook/popcorn.facebook.unit.js @@ -83,5 +83,23 @@ test("Popcorn Facebook Plugin", function () { ok ( document.getElementById( "facepilediv" ).innerHTML, "Facepilediv is not empty at 0:05 (expected)" ); plus(); }); + +}); + +test( "Test Empty Block", function () { + + Popcorn.plugin.debug = true; + + var pop = Popcorn( "#video" ); + + expect( 1 ); + + // Tests for thrown Error on emtpy block + try { + pop.facebook({}); + } catch( e ) { + ok( true, "Empty event was caught by debugger" ); + } + }); -- 2.43.0