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