Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
import {
ServiceLocationInfo,
BillingProviderInfo
} from '../../ewv-viewer/ewv-viewer.model';
import { VendorInfoComponent } from './vendor-info.component';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
describe('VendorInfoComponent', () => {
let component: VendorInfoComponent;
let ewvViewerService: EwvViewerService;
beforeEach(() => {
ewvViewerService = new EwvViewerService(null, null);
component = new VendorInfoComponent(ewvViewerService);
});
it('should be created', () => {
expect(component).toBeTruthy();
});
it('test ngOnInit method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.ngOnInit();
expect(component.billingProviderInfo.name).toEqual('');
expect(component.billingProviderInfo.taxIdNumber).toEqual('');
expect(component.billingProviderInfo.npi).toEqual('');
expect(component.billingProviderInfo.entityId).toEqual('');
expect(component.billingProviderInfo.billingVendorTaxonomyCode).toEqual('');
expect(component.billingProviderInfo.addressLineOne).toEqual('');
expect(component.billingProviderInfo.addressLineTwo).toEqual('');
expect(component.billingProviderInfo.city).toEqual('');
expect(component.billingProviderInfo.state).toEqual('');
expect(component.billingProviderInfo.postalCode).toEqual('');
expect(component.billingProviderInfo.country).toEqual('');
});
it('test ngOnChanges method', () => {
spyOn(component, 'populateData');
component.ngOnChanges();
expect(component.populateData).toHaveBeenCalled();
});
it('test populateData method', () => {
component.isSplitSubscription = undefined;
expect(component.isSplitView).toEqual(undefined);
component.populateData();
expect(component.isSplitView).toEqual(false);
expect(component.isSplitSubscription).toBeDefined();
expect(component.isSplitSubscription).not.toBeNull();
});
it('test getCopyServiceLocationInformationAddressTextValue method', () => {
component.serviceLocationInfo = new ServiceLocationInfo();
const returnValue = component.getCopyServiceLocationInformationAddressTextValue();
expect(returnValue).toEqual('\r, \r');
});
it('test getServiceLocationInformationName method', () => {
component.serviceLocationInfo = new ServiceLocationInfo();
component.serviceLocationInfo.name = 'Name';
const returnValue = component.getServiceLocationInformationName();
expect(returnValue).toEqual('Name');
});
it('test getServiceLocationInformationState method', () => {
component.serviceLocationInfo = new ServiceLocationInfo();
component.serviceLocationInfo.state = 'State';
const returnValue = component.getServiceLocationInformationState();
expect(returnValue).toEqual('State');
});
it('test getServiceLocationInformationZipCode method', () => {
component.serviceLocationInfo = new ServiceLocationInfo();
component.serviceLocationInfo.postalCode = 'ZipCode';
const returnValue = component.getServiceLocationInformationZipCode();
expect(returnValue).toEqual('ZipCode');
});
it('test getServiceLocationInformationCountry method', () => {
component.serviceLocationInfo = new ServiceLocationInfo();
component.serviceLocationInfo.country = 'Country';
const returnValue = component.getServiceLocationInformationCountry();
expect(returnValue).toEqual('Country');
});
it('test getBillingProviderInformationName method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.name = 'Name';
const returnValue = component.getBillingProviderInformationName();
expect(returnValue).toEqual('Name');
});
it('test getBillingProviderInformationAddressOne method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.addressLineOne = 'AddressLineOne';
const returnValue = component.getBillingProviderInformationAddressOne();
expect(returnValue).toEqual('AddressLineOne');
});
it('test getBillingProviderInformationAddressTwo method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.addressLineTwo = 'AddressLineTwo';
const returnValue = component.getBillingProviderInformationAddressTwo();
expect(returnValue).toEqual('AddressLineTwo');
});
it('test getBillingProviderInformationCity method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.city = 'City';
const returnValue = component.getBillingProviderInformationCity();
expect(returnValue).toEqual('City');
});
it('test getBillingProviderInformationState method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.state = 'State';
const returnValue = component.getBillingProviderInformationState();
expect(returnValue).toEqual('State');
});
it('test getBillingProviderInformationZipCode method', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.postalCode = 'ZipCode';
const returnValue = component.getBillingProviderInformationZipCode();
expect(returnValue).toEqual('ZipCode');
});
it('test getBillingProviderInformationCountry method: "component.data.billingProviderInfo" has "country" property with non-empty string value', () => {
component.billingProviderInfo = new BillingProviderInfo();
component.billingProviderInfo.country = 'Country';
const returnValue = component.getBillingProviderInformationCountry();
expect(returnValue).toEqual('Country');
});
it('test ngOnDestroy method', () => {
spyOn(component.collapseStateSubscription, 'unsubscribe');
spyOn(component.isSplitSubscription, 'unsubscribe');
component.ngOnDestroy();
expect(component.collapseStateSubscription.unsubscribe).toHaveBeenCalled();
expect(component.isSplitSubscription.unsubscribe).toHaveBeenCalled();
});
it('test copyStringToClipboard method', () => {
const returnedElement = {
value: '',
setAttribute: () => true,
select: () => true,
style: {
position: '',
left: ''
}
};
spyOn(document, 'createElement').and.callFake(() => returnedElement);
spyOn(document, 'execCommand');
spyOn(document.body, 'appendChild');
spyOn(document.body, 'removeChild');
spyOn(returnedElement, 'setAttribute');
spyOn(returnedElement, 'select');
component.copyStringToClipboard('Copy Text Value');
expect(document.createElement).toHaveBeenCalled();
expect(document.createElement).toHaveBeenCalledWith('textarea');
expect(document.body.appendChild).toHaveBeenCalled();
expect(document.body.appendChild).toHaveBeenCalledWith(returnedElement);
expect(document.body.removeChild).toHaveBeenCalled();
expect(document.body.removeChild).toHaveBeenCalledWith(returnedElement);
expect(document.execCommand).toHaveBeenCalled();
expect(document.execCommand).toHaveBeenCalledWith('copy');
expect(returnedElement.setAttribute).toHaveBeenCalled();
expect(returnedElement.setAttribute).toHaveBeenCalledWith('readonly', '');
expect(returnedElement.select).toHaveBeenCalled();
expect(returnedElement.style.position).toEqual('absolute');
expect(returnedElement.style.left).toEqual('-9999px');
expect(returnedElement.value).toEqual('Copy Text Value');
});
it('test copyServiceLocationInformationAddressToClipboard method', () => {
spyOn(
component,
'getCopyServiceLocationInformationAddressTextValue'
).and.callFake(() => 'Copy Text Value');
spyOn(component, 'copyStringToClipboard');
component.copyServiceLocationInformationAddressToClipboard();
expect(component.copyStringToClipboard).toHaveBeenCalled();
expect(component.copyStringToClipboard).toHaveBeenCalledWith(
'Copy Text Value'
);
});
it('test copyBillingProviderInformationAddressToClipboard method', () => {
spyOn(
component,
'getCopyBillingProviderInformationAddressTextValue'
).and.callFake(() => 'Copy Text Value');
spyOn(component, 'copyStringToClipboard');
component.copyBillingProviderInformationAddressToClipboard();
expect(component.copyStringToClipboard).toHaveBeenCalled();
expect(component.copyStringToClipboard).toHaveBeenCalledWith(
'Copy Text Value'
);
});
});