test(matchers): support 'not' text in toBeHidden matcher

This commit is contained in:
Chirayu Krishnappa 2013-08-06 21:53:51 -07:00
parent 66007a4150
commit 4be7612079

View file

@ -40,11 +40,13 @@ beforeEach(function() {
toBeDirty: cssMatcher('ng-dirty', 'ng-pristine'),
toBePristine: cssMatcher('ng-pristine', 'ng-dirty'),
toBeShown: function() {
this.message = valueFn("Expected element to not have 'ng-hide' class");
this.message = valueFn(
"Expected element " + (this.isNot ? "": "not ") + "to have 'ng-hide' class");
return !isNgElementHidden(this.actual);
},
toBeHidden: function() {
this.message = valueFn("Expected element to have 'ng-hide' class");
this.message = valueFn(
"Expected element " + (this.isNot ? "not ": "") + "to have 'ng-hide' class");
return isNgElementHidden(this.actual);
},