[ADF-2961] support for protocol substition in app config files (#3324)

* support for protocol substition in app config files

* Update app-config.service.spec.ts

* Update app-config.service.spec.ts
This commit is contained in:
Denys Vuika
2018-05-15 13:10:27 +01:00
committed by GitHub
parent f159fbaa2c
commit db7d0b7c08
3 changed files with 23 additions and 2 deletions

View File

@@ -113,6 +113,18 @@ describe('AppConfigService', () => {
expect(appConfigService.get('testUrl')).toBe('http://localhost:9090');
});
it('should use protocol value', () => {
spyOn(appConfigService, 'getLocationPort').and.returnValue('9090');
const protocolSpy = spyOn(appConfigService, 'getLocationProtocol');
appConfigService.config.testUrl = '{protocol}//{hostname}:{port}';
protocolSpy.and.returnValue('https:');
expect(appConfigService.get('testUrl')).toBe('https://localhost:9090');
protocolSpy.and.returnValue('ftp:');
expect(appConfigService.get('testUrl')).toBe('ftp://localhost:9090');
});
it('should load external settings', () => {
appConfigService.load().then(config => {
expect(config).toEqual(mockResponse);