blob: 5dd44dbc4760d658865d864b62bab115cf2a1fd7 [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';
5import {IRuntimeStatesService} from './runtime-states';
6
7let service: IRuntimeStatesService, $state: ng.ui.IStateService;
8
9describe('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});