Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4be7612

Browse files
committed
test(matchers): support 'not' text in toBeHidden matcher
1 parent 66007a4 commit 4be7612

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/matchers.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ beforeEach(function() {
4040
toBeDirty: cssMatcher('ng-dirty', 'ng-pristine'),
4141
toBePristine: cssMatcher('ng-pristine', 'ng-dirty'),
4242
toBeShown: function() {
43-
this.message = valueFn("Expected element to not have 'ng-hide' class");
43+
this.message = valueFn(
44+
"Expected element " + (this.isNot ? "": "not ") + "to have 'ng-hide' class");
4445
return !isNgElementHidden(this.actual);
4546
},
4647
toBeHidden: function() {
47-
this.message = valueFn("Expected element to have 'ng-hide' class");
48+
this.message = valueFn(
49+
"Expected element " + (this.isNot ? "not ": "") + "to have 'ng-hide' class");
4850
return isNgElementHidden(this.actual);
4951
},
5052

0 commit comments

Comments
 (0)