From bcf18b8ad79a47393a6518456275ff007459e0be Mon Sep 17 00:00:00 2001 From: Alex Dik Date: Fri, 29 Jul 2016 17:05:40 +0200 Subject: [PATCH] Test apiPaths for appBasePath --- .../api/api-paths/api-paths.service.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/api/api-paths/api-paths.service.test.ts b/frontend/app/components/api/api-paths/api-paths.service.test.ts index dd00371ad3..4bbc65ea77 100644 --- a/frontend/app/components/api/api-paths/api-paths.service.test.ts +++ b/frontend/app/components/api/api-paths/api-paths.service.test.ts @@ -30,25 +30,30 @@ import {opApiModule, opServicesModule} from '../../../angular-modules'; describe('apiPaths', () => { var apiPaths:any; + var appBasePath:string; beforeEach(angular.mock.module( opApiModule.name, opServicesModule.name )); - beforeEach(angular.mock.inject(function (_apiPaths_) { - apiPaths = _apiPaths_; + beforeEach(angular.mock.inject(function (_apiPaths_, _appBasePath_) { + [apiPaths, appBasePath] = _.toArray(arguments); })); it('should exist', () => { expect(apiPaths).to.exist; }); - it('should have a ex property', () => { + it('should have an `ex` property', () => { expect(apiPaths).to.have.property('ex'); }); - it('should have a v3 property', () => { + it('should have a `v3` property', () => { expect(apiPaths).to.have.property('v3'); }); + + it('should return the appBasePath', () => { + expect(apiPaths()).to.equal(appBasePath); + }); });