From: Christopher De Cairos Date: Mon, 30 May 2011 15:42:46 +0000 (-0400) Subject: made bad type default to like button, updated tests to reflect new behaviour X-Git-Tag: v0.7^2~45^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0f44ec7ec668a797ddd5ef22049fabffbe14a8b1;p=popcorn-js.git made bad type default to like button, updated tests to reflect new behaviour --- diff --git a/plugins/facebook/popcorn.facebook.js b/plugins/facebook/popcorn.facebook.js index 3020822..cfcd83c 100644 --- a/plugins/facebook/popcorn.facebook.js +++ b/plugins/facebook/popcorn.facebook.js @@ -126,7 +126,7 @@ // default plugin is like button if ( !validType( options.type ) ) { - return; + options.type = "like"; } options._container = document.createElement( "fb:" + options.type ); diff --git a/plugins/facebook/popcorn.facebook.unit.js b/plugins/facebook/popcorn.facebook.unit.js index dd6b86d..6da251e 100644 --- a/plugins/facebook/popcorn.facebook.unit.js +++ b/plugins/facebook/popcorn.facebook.unit.js @@ -67,7 +67,7 @@ test("Popcorn Facebook Plugin", function () { }); popped.exec( 3, function() { - ok ( document.getElementById( "likeboxdiv" ).innerHTML.length === 0, "Like box is not added to div" ); + ok ( document.getElementById( "likeboxdiv" ).innerHTML.length > 0, "Incorrent type value defaulted to like button" ); plus(); });