]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
made bad type default to like button, updated tests to reflect new behaviour
authorChristopher De Cairos <chris.decairos@gmail.com>
Mon, 30 May 2011 15:42:46 +0000 (11:42 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Mon, 30 May 2011 15:42:46 +0000 (11:42 -0400)
plugins/facebook/popcorn.facebook.js
plugins/facebook/popcorn.facebook.unit.js

index 3020822d8f5e0854df54d7fa989461649f817423..cfcd83c413360cefa1ffc2fc3684983dbf457617 100644 (file)
 
       // default plugin is like button
       if ( !validType( options.type ) ) {
-        return;
+        options.type = "like";
       }
 
       options._container = document.createElement( "fb:" + options.type );
index dd6b86d2cd4d52438c7fdc29d789919e0140ae9c..6da251e977759a2483c4269774dcb9cc8d6a7b36 100644 (file)
@@ -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();
   });