Matteo Scandolo | ef96992 | 2016-08-11 13:49:12 -0700 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | describe('The Js Shell directive', () => { |
| 4 | |
| 5 | var scope, element, isolatedScope, shellSpy; |
| 6 | |
| 7 | beforeEach(module('xos.UITutorial')); |
| 8 | beforeEach(module('templates')); |
| 9 | |
| 10 | beforeEach(inject(function($compile, $rootScope){ |
| 11 | scope = $rootScope.$new(); |
| 12 | element = angular.element('<js-shell></js-shell>'); |
| 13 | $compile(element)(scope); |
| 14 | scope.$digest(); |
| 15 | isolatedScope = element.isolateScope().vm; |
| 16 | spyOn(isolatedScope.shell, 'setCommandHandler'); |
| 17 | spyOn(isolatedScope.shell, 'activate'); |
| 18 | })); |
| 19 | |
| 20 | // NOTE see http://stackoverflow.com/questions/38906605/angular-jasmine-testing-immediatly-invoked-functions-inside-a-directive-contr |
| 21 | |
| 22 | xit('should register the explore command', () => { |
| 23 | expect(isolatedScope.shell.setCommandHandler).toHaveBeenCalled(); |
| 24 | }); |
| 25 | |
| 26 | xit('should activate the shell', () => { |
| 27 | expect(isolatedScope.shell.activate).toHaveBeenCalled(); |
| 28 | }); |
| 29 | }); |