Matteo Scandolo | a4a4711 | 2016-12-16 10:06:13 -0800 | [diff] [blame] | 1 | import * as angular from 'angular'; |
| 2 | import 'angular-mocks'; |
| 3 | import 'angular-ui-router'; |
| 4 | import {xosCore} from '../index'; |
| 5 | import {IRuntimeStatesService} from './runtime-states'; |
| 6 | |
| 7 | let service: IRuntimeStatesService, $state: ng.ui.IStateService; |
| 8 | |
| 9 | describe('The Navigation service', () => { |
| 10 | |
| 11 | beforeEach(angular.mock.module(xosCore)); |
| 12 | |
| 13 | beforeEach(angular.mock.inject(( |
| 14 | RuntimeStates: IRuntimeStatesService, |
| 15 | _$state_: ng.ui.IStateService |
| 16 | ) => { |
| 17 | service = RuntimeStates; |
| 18 | $state = _$state_; |
| 19 | })); |
| 20 | |
| 21 | it('should add a state', () => { |
| 22 | service.addState('testState', { |
| 23 | url: 'test-state', |
| 24 | template: 'test-state' |
| 25 | }); |
| 26 | |
| 27 | expect($state.get('testState').url).toEqual('test-state'); |
| 28 | expect($state.get('testState').template).toEqual('test-state'); |
| 29 | }); |
| 30 | }); |