aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2010-04-08 15:05:05 -0700
committerMisko Hevery2010-04-08 15:05:05 -0700
commit41a5c408c242269bf31bc0b774c7304fdf7c2f1c (patch)
treeaa48e2eff595691b4f4ee07d0307fcd95ebd0956 /test
parentc4ef1f2fdd73bdaeda879e596d3d96e4e68cb6fd (diff)
downloadangular.js-41a5c408c242269bf31bc0b774c7304fdf7c2f1c.tar.bz2
tests pass jstd has issues
Diffstat (limited to 'test')
-rw-r--r--test/BinderTest.js6
-rw-r--r--test/directivesSpec.js10
-rw-r--r--test/servicesSpec.js4
3 files changed, 7 insertions, 13 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js
index e72afa9f..ec0c1cb4 100644
--- a/test/BinderTest.js
+++ b/test/BinderTest.js
@@ -506,10 +506,8 @@ BinderTest.prototype.testFillInOptionValueWhenMissing = function() {
};
BinderTest.prototype.testValidateForm = function() {
- var doc = jqLite(document.body);
- doc.append('<div><input name="name" ng-required>' +
+ var c = this.compile('<div><input name="name" ng-required>' +
'<div ng-repeat="item in items"><input name="item.name" ng-required/></div></div>');
- var c = this.compile(doc);
var items = [{}, {}];
c.scope.$set("items", items);
c.scope.$eval();
@@ -545,7 +543,7 @@ BinderTest.prototype.testValidateOnlyVisibleItems = function(){
c.scope.$set("show", false);
c.scope.$eval();
- assertEquals(1, c.scope.$get("$invalidWidgets.length"));
+ assertEquals(1, c.scope.$invalidWidgets.visible());
};
BinderTest.prototype.testDeleteAttributeIfEvaluatesFalse = function() {
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 0af61997..1def9584 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -141,22 +141,20 @@ describe("directives", function(){
it('should ng-show', function(){
var scope = compile('<div ng-hide="hide"></div>');
- jqLite(document.body).append(scope.$element);
scope.$eval();
- expect(isVisible(scope.$element)).toEqual(true);
+ expect(isCssVisible(scope.$element)).toEqual(true);
scope.$set('hide', true);
scope.$eval();
- expect(isVisible(scope.$element)).toEqual(false);
+ expect(isCssVisible(scope.$element)).toEqual(false);
});
it('should ng-hide', function(){
var scope = compile('<div ng-show="show"></div>');
- jqLite(document.body).append(scope.$element);
scope.$eval();
- expect(isVisible(scope.$element)).toEqual(false);
+ expect(isCssVisible(scope.$element)).toEqual(false);
scope.$set('show', true);
scope.$eval();
- expect(isVisible(scope.$element)).toEqual(true);
+ expect(isCssVisible(scope.$element)).toEqual(true);
});
it('should ng-controller', function(){
diff --git a/test/servicesSpec.js b/test/servicesSpec.js
index a3841c2f..b7dfe4c8 100644
--- a/test/servicesSpec.js
+++ b/test/servicesSpec.js
@@ -66,9 +66,7 @@ describe("service $invalidWidgets", function(){
});
it("should count number of invalid widgets", function(){
- var doc = jqLite(window.document.body);
- doc.append('<input name="price" ng-required></input>');
- var scope = compile(doc).$init();
+ var scope = compile('<input name="price" ng-required></input>').$init();
expect(scope.$invalidWidgets.length).toEqual(1);
scope.price = 123;
scope.$eval();