aboutsummaryrefslogtreecommitdiffstats
path: root/test/matchers.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-06-18 13:59:57 -0400
committerMisko Hevery2013-07-26 23:49:54 -0700
commit81923f1e41560327f7de6e8fddfda0d2612658f3 (patch)
treebbf8151bddf4d026f8f5fa3196b84a45ecd9c858 /test/matchers.js
parent11521a4cde689c2bd6aaa227b1f45cb3fb53725b (diff)
downloadangular.js-81923f1e41560327f7de6e8fddfda0d2612658f3.tar.bz2
feat(ngAnimate): complete rewrite of animations
- ngAnimate directive is gone and was replaced with class based animations/transitions - support for triggering animations on css class additions and removals - done callback was added to all animation apis - $animation and $animator where merged into a single $animate service with api: - $animate.enter(element, parent, after, done); - $animate.leave(element, done); - $animate.move(element, parent, after, done); - $animate.addClass(element, className, done); - $animate.removeClass(element, className, done); BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
Diffstat (limited to 'test/matchers.js')
-rw-r--r--test/matchers.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/matchers.js b/test/matchers.js
index 67efd3e7..ef89e3ee 100644
--- a/test/matchers.js
+++ b/test/matchers.js
@@ -30,11 +30,23 @@ beforeEach(function() {
return -1;
}
+ function isNgElementHidden(element) {
+ return angular.element(element).hasClass('ng-hide');
+ };
+
this.addMatchers({
toBeInvalid: cssMatcher('ng-invalid', 'ng-valid'),
toBeValid: cssMatcher('ng-valid', 'ng-invalid'),
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");
+ return !isNgElementHidden(this.actual);
+ },
+ toBeHidden: function() {
+ this.message = valueFn("Expected element to have 'ng-hide' class");
+ return isNgElementHidden(this.actual);
+ },
toEqual: function(expected) {
if (this.actual && this.actual.$$log) {