Created
February 4, 2014 22:33
-
-
Save rolaveric/8813721 to your computer and use it in GitHub Desktop.
An ng-hide directive test taken from the AngularJS source to illustrate a simple directive test.
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('ngHide', function() { | |
it('should hide an element', inject(function($rootScope, $compile) { | |
var element = angular.element('<div ng-hide="exp"></div>'); | |
element = $compile(element)($rootScope); | |
expect(element).toBeShown(); | |
$rootScope.exp = true; | |
$rootScope.$digest(); | |
expect(element).toBeHidden(); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment