aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2011-02-13 16:13:21 -0800
committerMisko Hevery2011-02-16 08:59:57 -0500
commitc90abf057b0370cf5beb62aa960f1df008c802ef (patch)
tree039525ec1ee518175010693efd278fa105815285 /test
parentcdc093a463e8f8a925cbb9f2b55bedf0a1d8e7e8 (diff)
downloadangular.js-c90abf057b0370cf5beb62aa960f1df008c802ef.tar.bz2
Changed the angular.compile(element)(scope[, cloneAttachNode])
Diffstat (limited to 'test')
-rw-r--r--test/AngularSpec.js8
-rw-r--r--test/BinderSpec.js2
-rw-r--r--test/CompilerSpec.js4
-rw-r--r--test/jqLiteSpec.js8
4 files changed, 16 insertions, 6 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index 8ff0631d..8753d887 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -369,8 +369,10 @@ describe('angular', function(){
var scope = angular.scope();
var template = jqLite('<div>{{greeting = "hello world"}}</div>');
var templateFn = angular.compile(template);
- var templateClone = template.cloneNode();
- mvc = templateFn(scope, templateClone);
+ var templateClone = template.clone();
+ mvc = templateFn(scope, function(clone){
+ templateClone = clone;
+ });
expect(template.text()).toEqual('');
expect(mvc.view.text()).toEqual('hello world');
expect(mvc.view).toEqual(templateClone);
@@ -380,7 +382,7 @@ describe('angular', function(){
it('should link to cloned node and create scope', function(){
var scope = angular.scope();
var template = jqLite('<div>{{greeting = "hello world"}}</div>');
- mvc = angular.compile(template)(scope, true);
+ mvc = angular.compile(template)(scope, noop);
expect(template.text()).toEqual('');
expect(mvc.view.text()).toEqual('hello world');
expect(mvc.scope.greeting).toEqual('hello world');
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index a1b9be14..ce2a9d3a 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -417,7 +417,7 @@ describe('Binder', function(){
});
it('BindClassEvenOdd', function(){
- var x = this.compile('<div><div ng:repeat="i in [0,1]" ng:class-even="\'e\'" ng:class-odd="\'o\'"/></div>');
+ var x = this.compile('<div><div ng:repeat="i in [0,1]" ng:class-even="\'e\'" ng:class-odd="\'o\'"></div></div>');
x.scope.$eval();
var d1 = jqLite(x.view[0].childNodes[1]);
var d2 = jqLite(x.view[0].childNodes[2]);
diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js
index 1a93ac78..f1e1c607 100644
--- a/test/CompilerSpec.js
+++ b/test/CompilerSpec.js
@@ -47,7 +47,7 @@ describe('compiler', function(){
};
var template = compiler.compile(e);
expect(log).toEqual("found");
- scope = template(angular.scope(), e).scope;
+ scope = template(angular.scope()).scope;
expect(e.hasClass('ng-directive')).toEqual(true);
expect(log).toEqual("found:init");
});
@@ -84,7 +84,7 @@ describe('compiler', function(){
var template = this.compile(element);
return function(marker) {
this.$onEval(function() {
- marker.after(template(angular.scope(), true).view);
+ marker.after(template(angular.scope(), noop).view);
});
};
};
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index c5e92c0f..e42e9f14 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -300,6 +300,14 @@ describe('jqLite', function(){
expect(element.parent().length).toEqual(0);
});
});
+ describe('next', function(){
+ it('should return next sibling', function(){
+ var element = jqLite('<div><b>b</b><i>i</i></div>');
+ var b = element.find('b');
+ var i = element.find('i');
+ expect(b.next()).toJqEqual([i]);
+ });
+ });
describe('find', function(){
it('should find child by name', function(){
var root = jqLite('<div><div>text</div></div>');