mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user