blob: de478d0ebee104aaa5fb5b6d80cf7a3ee4b5a1a0 [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { AppConfigService } from '@grid-failure-information-map-app/app/app-config.service';
describe('AppConfigService', () => {
let service: AppConfigService;
let mockHttpClient;
let baseHref: string;
beforeEach(() => {
mockHttpClient = { get: () => {} };
service = new AppConfigService(mockHttpClient, baseHref);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
it('should define baseHref if undefined', () => {
service['baseHref'] = undefined;
service.getConfig();
expect(service['baseHref']).toBe('');
});
it('should not redefine baseHref if it is already defined', () => {
service['baseHref'] = 'x';
service.getConfig();
expect(service['baseHref']).not.toBe('');
});
});