Last active
December 26, 2015 07:38
-
-
Save trodrigues/7116176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Testing something', function () { | |
var container, scope; | |
beforeEach(function () { | |
inject(function ($rootScope, $compile) { | |
scope = $rootScope.$new(); | |
scope.can = function () { | |
return false; | |
}; | |
container = angular.element('<div><div class="container" ng-show="can()">{{can()}}</div></div>'); | |
$compile(container)(scope); | |
scope.$digest(); | |
}); | |
}); | |
it('should be hidden if can returns false', function () { | |
// passes | |
expect(container.find('.container').hasClass('container')).toBe(true); | |
// passes | |
expect(container.find('.container').text()).toBe('false'); | |
// doesn't pass, ng-show never does it's thing | |
expect(container.find('.container').hasClass('ng-hide')).toBe(true); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is due to ng-animate inside ng-hide and it's fixed by updating to the latest 1.2.0-rc3