diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/rootElementSpec.js | 12 | ||||
| -rw-r--r-- | test/ngMock/angular-mocksSpec.js | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/ng/rootElementSpec.js b/test/ng/rootElementSpec.js new file mode 100644 index 00000000..81272093 --- /dev/null +++ b/test/ng/rootElementSpec.js @@ -0,0 +1,12 @@ +'use strict'; + +describe('$rootElement', function() { + it('should publish the bootstrap element into $rootElement', function() { + var element = jqLite('<div></div>'); + var injector = angular.bootstrap(element); + + expect(injector.get('$rootElement')[0]).toBe(element[0]); + + dealoc(element); + }); +}); diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js index 62190072..f4f6a346 100644 --- a/test/ngMock/angular-mocksSpec.js +++ b/test/ngMock/angular-mocksSpec.js @@ -950,6 +950,13 @@ describe('ngMock', function() { }); }); }); + + + describe('$rootElement', function() { + it('should create mock application root', inject(function($rootElement) { + expect($rootElement.text()).toEqual(''); + })); + }); }); |
