Test apiPaths for appBasePath

pull/4734/head
Alex Dik 8 years ago
parent b764095348
commit bcf18b8ad7
  1. 13
      frontend/app/components/api/api-paths/api-paths.service.test.ts

@ -30,25 +30,30 @@ import {opApiModule, opServicesModule} from '../../../angular-modules';
describe('apiPaths', () => { describe('apiPaths', () => {
var apiPaths:any; var apiPaths:any;
var appBasePath:string;
beforeEach(angular.mock.module( beforeEach(angular.mock.module(
opApiModule.name, opApiModule.name,
opServicesModule.name opServicesModule.name
)); ));
beforeEach(angular.mock.inject(function (_apiPaths_) { beforeEach(angular.mock.inject(function (_apiPaths_, _appBasePath_) {
apiPaths = _apiPaths_; [apiPaths, appBasePath] = _.toArray(arguments);
})); }));
it('should exist', () => { it('should exist', () => {
expect(apiPaths).to.exist; expect(apiPaths).to.exist;
}); });
it('should have a ex property', () => { it('should have an `ex` property', () => {
expect(apiPaths).to.have.property('ex'); expect(apiPaths).to.have.property('ex');
}); });
it('should have a v3 property', () => { it('should have a `v3` property', () => {
expect(apiPaths).to.have.property('v3'); expect(apiPaths).to.have.property('v3');
}); });
it('should return the appBasePath', () => {
expect(apiPaths()).to.equal(appBasePath);
});
}); });

Loading…
Cancel
Save