blob: 9c168df519f3539d0219486455c651069e6c743f [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 { async } from '@angular/core/testing';
import { ExternalPersonAddressDetailsComponent } from '@pages/persons/external-person/external-person-details/address-details/address-details.component';
describe('AddressDetailsComponent', () => {
let component: ExternalPersonAddressDetailsComponent;
let externalPersonSandbox: any;
beforeEach(async(() => {
externalPersonSandbox = {
registerAddressEvents() {},
registerExternalPersonEvents() {},
endSubscriptions() {},
clearAddressData() {},
} as any;
}));
beforeEach(() => {
component = new ExternalPersonAddressDetailsComponent(externalPersonSandbox);
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should call registerAddressEvents and clearAddressData onInit', () => {
const spy1 = spyOn(externalPersonSandbox, 'registerAddressEvents');
const spy2 = spyOn(externalPersonSandbox, 'clearAddressData');
component.ngOnInit();
expect(spy1).toHaveBeenCalled();
expect(spy2).toHaveBeenCalled();
});
});