Added tests
Change-Id: I493675212f4b1548b32a6d92ce3664d184bc0e04
diff --git a/src/app/core/services/runtime-states.spec.ts b/src/app/core/services/runtime-states.spec.ts
new file mode 100644
index 0000000..5dd44db
--- /dev/null
+++ b/src/app/core/services/runtime-states.spec.ts
@@ -0,0 +1,30 @@
+import * as angular from 'angular';
+import 'angular-mocks';
+import 'angular-ui-router';
+import {xosCore} from '../index';
+import {IRuntimeStatesService} from './runtime-states';
+
+let service: IRuntimeStatesService, $state: ng.ui.IStateService;
+
+describe('The Navigation service', () => {
+
+ beforeEach(angular.mock.module(xosCore));
+
+ beforeEach(angular.mock.inject((
+ RuntimeStates: IRuntimeStatesService,
+ _$state_: ng.ui.IStateService
+ ) => {
+ service = RuntimeStates;
+ $state = _$state_;
+ }));
+
+ it('should add a state', () => {
+ service.addState('testState', {
+ url: 'test-state',
+ template: 'test-state'
+ });
+
+ expect($state.get('testState').url).toEqual('test-state');
+ expect($state.get('testState').template).toEqual('test-state');
+ });
+});