Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add test for extending existing Zepto objects with plugins

  • Loading branch information...
commit 0795ae3ba9d36ba946c42c1f84e56e030fda1751 1 parent 58d07dc
@madrobby authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/zepto.html
View
8 test/zepto.html
@@ -404,6 +404,14 @@
};
$('#some_element').plugin();
t.assertEqual('plugin!', el.innerHTML);
+
+ // test if existing Zepto objects receive new plugins
+ $.fn.anotherplugin = function(){
+ return this.each(function(el){ el.innerHTML = 'anotherplugin!' });
+ }
+ t.assert(typeof $('#some_element').anotherplugin == 'function');
+ $('#some_element').anotherplugin();
+ t.assertEqual('anotherplugin!', el.innerHTML);
},
testAppendPrependBeforeAfter: function(t){
Please sign in to comment.
Something went wrong with that request. Please try again.