From 2430f52bb97fa9d682e5f028c977c5bf94c5ec38 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 23 Mar 2012 14:03:24 -0700 Subject: chore(module): move files around in preparation for more modules --- test/ng/directive/ngShowHideSpec.js | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/ng/directive/ngShowHideSpec.js (limited to 'test/ng/directive/ngShowHideSpec.js') diff --git a/test/ng/directive/ngShowHideSpec.js b/test/ng/directive/ngShowHideSpec.js new file mode 100644 index 00000000..5005274d --- /dev/null +++ b/test/ng/directive/ngShowHideSpec.js @@ -0,0 +1,43 @@ +'use strict'; + +describe('ng-show / ng-hide', function() { + var element; + + + afterEach(function() { + dealoc(element); + }); + + describe('ng-show', function() { + it('should show and hide an element', inject(function($rootScope, $compile) { + element = jqLite('
'); + element = $compile(element)($rootScope); + $rootScope.$digest(); + expect(isCssVisible(element)).toEqual(false); + $rootScope.exp = true; + $rootScope.$digest(); + expect(isCssVisible(element)).toEqual(true); + })); + + + it('should make hidden element visible', inject(function($rootScope, $compile) { + element = jqLite(''); + element = $compile(element)($rootScope); + expect(isCssVisible(element)).toBe(false); + $rootScope.exp = true; + $rootScope.$digest(); + expect(isCssVisible(element)).toBe(true); + })); + }); + + describe('ng-hide', function() { + it('should hide an element', inject(function($rootScope, $compile) { + element = jqLite(''); + element = $compile(element)($rootScope); + expect(isCssVisible(element)).toBe(true); + $rootScope.exp = true; + $rootScope.$digest(); + expect(isCssVisible(element)).toBe(false); + })); + }); +}); -- cgit v1.2.3