From 34f43c56588bb2e23dfd17e298a7b15d774eb1f6 Mon Sep 17 00:00:00 2001 From: Mihael Konjevic Date: Wed, 22 Jan 2014 16:53:48 -0800 Subject: [PATCH 1/3] Pluginified tests --- component/component_test.js | 306 +- component/test.html | 4 +- compute/compute_test.js | 70 +- compute/test.html | 5 +- construct/construct_test.js | 4 +- construct/proxy/proxy_test.js | 4 +- construct/proxy/test.html | 4 +- construct/super/super_test.js | 20 +- construct/super/test.html | 4 +- construct/test.html | 8 +- control/control_test.js | 8 +- control/modifier/test.html | 5 +- control/plugin/plugin_test.js | 4 +- control/plugin/test.html | 4 +- control/route/route_test.js | 21 +- control/route/test.html | 4 +- control/test.html | 4 +- list/list_test.js | 62 +- list/test.html | 4 +- map/attributes/attributes_test.js | 64 +- map/attributes/test.html | 2 +- map/backup/backup_test.js | 92 +- map/backup/test.html | 4 +- map/delegate/delegate_test.js | 68 +- map/delegate/test.html | 6 +- map/list/list_test.js | 4 +- map/list/test.html | 6 +- map/map_test.js | 50 +- map/setter/setter_test.js | 16 +- map/setter/test.html | 4 +- map/sort/sort_test.js | 4 +- map/sort/test.html | 8 +- map/test.html | 4 +- map/validations/test.html | 4 +- map/validations/validations_test.js | 90 +- model/model_test.js | 262 +- model/queue/queue_test.js | 18 +- model/queue/qunit.html | 9 +- model/test.html | 4 +- observe/observe_test.js | 272 +- observe/test.html | 4 +- route/pushstate/pushstate_test.js | 150 +- route/pushstate/test.html | 3 +- route/route_test.js | 68 +- route/test.html | 6 +- test/amd/dojo.html | 184 +- test/amd/jquery-2.html | 184 +- test/amd/jquery.html | 192 +- test/amd/mootools.html | 184 +- test/amd/yui.html | 184 +- test/amd/zepto.html | 184 +- test/dist/dojo.html | 38 +- test/dist/jquery-2.html | 38 +- test/dist/jquery.html | 40 +- test/dist/mootools.html | 38 +- test/dist/yui.html | 38 +- test/dist/zepto.html | 38 +- test/dojo.html | 8 +- test/jquery-2.html | 8 +- test/jquery.html | 8 +- test/mootools.html | 8 +- test/pluginified/pluginified.js | 15336 ++++++++++++++++ test/pluginify.js | 42 + .../templates/__configuration__-dist.html.ejs | 11 +- test/test.js | 4 +- test/yui.html | 8 +- test/zepto.html | 8 +- util/fixture/fixture.js | 118 +- util/fixture/fixture_test.js | 4 +- util/fixture/qunit.html | 47 +- util/object/object_test.js | 28 +- util/object/qunit.html | 38 +- util/string/qunit.html | 53 +- util/string/string_test.js | 4 +- view/bindings/bindings_test.js | 110 +- view/bindings/test.html | 5 +- view/ejs/ejs_test.js | 328 +- view/ejs/test.html | 4 +- view/live/live_test.js | 62 +- view/live/test.html | 4 +- view/modifiers/modifiers_test.js | 6 +- view/modifiers/test.html | 8 +- view/mustache/mustache_test.js | 308 +- view/mustache/test.html | 4 +- view/scope/scope_test.js | 226 +- view/scope/test.html | 4 +- view/test.html | 7 +- view/view_test.js | 62 +- 88 files changed, 17575 insertions(+), 2405 deletions(-) create mode 100644 test/pluginified/pluginified.js create mode 100644 test/pluginify.js diff --git a/component/component_test.js b/component/component_test.js index 6da9eea7367..d47ca4fd213 100644 --- a/component/component_test.js +++ b/component/component_test.js @@ -1,12 +1,12 @@ -(function(){ - +steal("can/component", function(){ + module("can/component",{ setup: function(){ can.remove( can.$("#qunit-test-area>*") ); } }) - - + + var Paginate = can.Map.extend({ count: Infinity, offset: 0, @@ -17,10 +17,10 @@ var Paginate = can.Map.extend({ }, // Prevent negative offsets setOffset: function(newOffset){ - return newOffset < 0 ? - 0 : - Math.min(newOffset, ! isNaN(this.count - 1) ? - this.count - 1 : + return newOffset < 0 ? + 0 : + Math.min(newOffset, ! isNaN(this.count - 1) ? + this.count - 1 : Infinity ) }, // move next @@ -31,7 +31,7 @@ var Paginate = can.Map.extend({ this.attr('offset', this.offset - this.limit ) }, canNext : function(){ - return this.attr('offset') < this.attr('count') - + return this.attr('offset') < this.attr('count') - this.attr('limit') }, canPrev: function(){ @@ -45,18 +45,18 @@ var Paginate = can.Map.extend({ } }, pageCount: function(){ - return this.attr('count') ? + return this.attr('count') ? Math.ceil( this.attr('count') / this.attr('limit') ) : null; } -}); - +}); + test("basic tabs",function(){ - - // new Tabs() .. + + // new Tabs() .. can.Component.extend({ tag: "tabs", - template: + template: "