aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2010-04-12 16:24:28 -0700
committerMisko Hevery2010-04-12 16:24:28 -0700
commit713307b6505a56ca7b5423b36e297070d756ff15 (patch)
tree9c229723ee42350e85fa376911e5f3501e6e3762 /test
parent841640e540b5e054a97e650bdd7b560680e94840 (diff)
downloadangular.js-713307b6505a56ca7b5423b36e297070d756ff15.tar.bz2
added ng-eval-order attribute
Diffstat (limited to 'test')
-rw-r--r--test/ApiTest.js2
-rw-r--r--test/CompilerSpec.js2
-rw-r--r--test/ValidatorsTest.js8
-rw-r--r--test/directivesSpec.js14
4 files changed, 22 insertions, 4 deletions
diff --git a/test/ApiTest.js b/test/ApiTest.js
index 5d85987b..4035cdbb 100644
--- a/test/ApiTest.js
+++ b/test/ApiTest.js
@@ -252,5 +252,5 @@ ApiTest.prototype.testStringFromUTC = function(){
};
ApiTest.prototype.testObjectShouldHaveExtend = function(){
- assertEquals(angular.Object.extend, extend);
+ assertEquals({a:1, b:2}, angular.Object.extend({a:1}, {b:2}));
};
diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js
index b9529e6e..fe61c520 100644
--- a/test/CompilerSpec.js
+++ b/test/CompilerSpec.js
@@ -72,7 +72,7 @@ describe('compiler', function(){
var scope = compile('<span hello="misko" stop="true"><span hello="adam"/></span>');
expect(log).toEqual("hello misko");
});
-
+
it('should allow creation of templates', function(){
directives.duplicate = function(expr, element){
element.replaceWith(document.createComment("marker"));
diff --git a/test/ValidatorsTest.js b/test/ValidatorsTest.js
index 17c67d38..49416ae4 100644
--- a/test/ValidatorsTest.js
+++ b/test/ValidatorsTest.js
@@ -88,11 +88,15 @@ describe('Validator:asynchronous', function(){
var value, fn;
beforeEach(function(){
+ var invalidWidgets = [];
+ invalidWidgets.markInvalid = function(element){
+ invalidWidgets.push(element);
+ };
value = null;
fn = null;
self = {
$element:jqLite('<input />'),
- $invalidWidgets:[],
+ $invalidWidgets:invalidWidgets,
$updateView: noop
};
});
@@ -125,7 +129,7 @@ describe('Validator:asynchronous', function(){
it("should not make second request to same value", function(){
asynchronous.call(self, "kai", function(v,f){value=v; fn=f;});
expect(value).toEqual('kai');
- expect(self.$invalidWidgets).toEqual([self.$element]);
+ expect(self.$invalidWidgets[0][0]).toEqual(self.$element[0]);
var spy = jasmine.createSpy();
asynchronous.call(self, "kai", spy);
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 300602fe..76a12616 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -181,4 +181,18 @@ describe("directives", function(){
expect(scope.greet('misko')).toEqual('hello misko!');
delete window.Greeter;
});
+
+ it('should eval things according to ng-eval-order', function(){
+ var scope = compile(
+ '<div ng-init="log=\'\'">' +
+ '{{log = log + \'e\'}}' +
+ '<span ng-eval-order="first" ng-eval="log = log + \'a\'">' +
+ '{{log = log + \'b\'}}' +
+ '<span src="{{log = log + \'c\'}}"></span>' +
+ '<span bind-template="{{log = log + \'d\'}}"></span>' +
+ '</span>' +
+ '</div>');
+ expect(scope.log).toEqual('abcde');
+ });
+
});