blob: 8b9015d06684ff8ed7a3202f29744fbd8ebb04a6 [file] [log] [blame]
Matteo Scandoloa4a47112016-12-16 10:06:13 -08001import * as angular from 'angular';
2import 'angular-mocks';
3import 'angular-ui-router';
4import {xosCore} from '../index';
Matteo Scandolo1aee1982017-02-17 08:33:23 -08005import {IXosRuntimeStatesService} from './runtime-states';
Matteo Scandoloa4a47112016-12-16 10:06:13 -08006
Matteo Scandolo1aee1982017-02-17 08:33:23 -08007let service: IXosRuntimeStatesService, $state: ng.ui.IStateService;
Matteo Scandoloa4a47112016-12-16 10:06:13 -08008
9describe('The Navigation service', () => {
10
11 beforeEach(angular.mock.module(xosCore));
12
13 beforeEach(angular.mock.inject((
Matteo Scandolo1aee1982017-02-17 08:33:23 -080014 XosRuntimeStates: IXosRuntimeStatesService,
Matteo Scandoloa4a47112016-12-16 10:06:13 -080015 _$state_: ng.ui.IStateService
16 ) => {
Matteo Scandolo1aee1982017-02-17 08:33:23 -080017 service = XosRuntimeStates;
Matteo Scandoloa4a47112016-12-16 10:06:13 -080018 $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});