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 { AttachmentViewerService } from '../../../shared/attachment-viewer/attachment-viewer.service';
// import { BehaviorSubject } from 'rxjs/BehaviorSubject';
// import { BillingMiscellaneousComponent } from './billing-miscellaneous.component';
// import { BillingMiscellaneousService } from './billing-miscellaneous.service';
// import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
// import { Observable } from 'rxjs/Observable';
// import { Observer } from 'rxjs/Observer';
// import { SimpleChanges } from '@angular/core';

// describe('BillingMiscellaneousComponent', () => {
// let component: BillingMiscellaneousComponent;
// let ewvViewerService: EwvViewerService;
// let billingMiscellanousService: BillingMiscellaneousService;
// let viewerService: AttachmentViewerService;

// beforeEach(() => {
// ewvViewerService = new EwvViewerService(null, null);
// billingMiscellanousService = new BillingMiscellaneousService();
// viewerService = new AttachmentViewerService(null);
// component = new BillingMiscellaneousComponent(
// ewvViewerService,
// billingMiscellanousService,
// viewerService
// );
// });

// it('should be created', () => {
// expect(component).toBeTruthy();
// });


// it('test ngOnInit method', () => {
// component.data = {};
// ewvViewerService.isSplitView = new BehaviorSubject<boolean>(false);
// expect(component.isSplitView).toEqual(undefined);
// expect(component.attachmentList).toEqual([]);

// spyOn(component, 'populateData');

// const getAttachmentsReturnedData = {
// pdiRelatedResponse: ['DATA_1', 'DATA_2', 'DATA_3']
// };
// spyOn(ewvViewerService, 'getAttachments').and.callFake(
// () =>
// new Observable((observer: Observer<{}>) =>
// observer.next(getAttachmentsReturnedData)
// )
// );

// component.ngOnInit();

// expect(component.isSplitView).toEqual(false);
// expect(component.attachmentList).toEqual(
// getAttachmentsReturnedData.pdiRelatedResponse
// );

// expect(component.populateData).toHaveBeenCalled();
// expect(ewvViewerService.getAttachments).toHaveBeenCalled();
// });


// it('test populateData method', () => {
// component.data = {
// healthCareInfo: {
// healthCareDRGInformationBeanList: [
// { code: 'CODE_1' },
// { code: 'CODE_2' },
// { code: 'CODE_3' }
// ]
// }
// };
// expect(component.diagnosisRelatedGroup).toEqual('N/A');

// component.populateData();

// expect(component.diagnosisRelatedGroup).toEqual('CODE_1');
// });


// it('test ngOnChanges method', () => {
// spyOn(component, 'populateData');
// spyOn(component, 'getAttachmentData');
// expect(component.data).toEqual(undefined);

// let changes;
// changes = {
// data: {}
// };

// component.ngOnChanges(changes);
// expect(component.getAttachmentData).toHaveBeenCalled();

// expect(component.data).toEqual(undefined);
// expect(component.populateData).not.toHaveBeenCalled();
// });


// it('test getAttachmentIcon method', () => {
// const result = component.getAttachmentIcon({attachmentPath: ['.XML', '.XML']});

// expect(result).toEqual('./../../../assets/images/ic_XML_icon_24.svg');
// });


// it('test ngOnDestroy method', () => {
// component.data = {};

// const getAttachmentsReturnedData = {
// pdiRelatedResponse: ['DATA_1', 'DATA_2', 'DATA_3']
// };
// spyOn(ewvViewerService, 'getAttachments').and.callFake(
// () =>
// new Observable((observer: Observer<{}>) =>
// observer.next(getAttachmentsReturnedData)
// )
// );

// component.ngOnInit();
// expect(ewvViewerService.getAttachments).toHaveBeenCalled();

// spyOn(component.collapseStateSubscription, 'unsubscribe');
// spyOn(component.isSplitSubscription, 'unsubscribe');

// component.ngOnDestroy();

// expect(component.collapseStateSubscription.unsubscribe).toHaveBeenCalled();
// expect(component.isSplitSubscription.unsubscribe).toHaveBeenCalled();
// });


// it('test onDisplayAttachmentViewer method', () => {
// spyOn(viewerService, 'setAttachmentViewerState');

// component.attachmentViewerComponent = {
// fileExtension: ''
// };

// const attachmentInputParameter = {
// attachmentPath: ['first.second.third.pdf']
// };
// component.onDisplayAttachmentViewer(attachmentInputParameter);

// expect(viewerService.setAttachmentViewerState).toHaveBeenCalled();
// expect(viewerService.setAttachmentViewerState).toHaveBeenCalledWith(true);

// expect(component.tabbable).toEqual(false);
// expect(component.selectedAttachment).toEqual('first.second.third.pdf');
// expect(component.attachmentViewerComponent.fileExtension).toEqual('PDF');
// expect(component.displayAttachmentViewer).toEqual(true);
// });

// it('test onAttachmentViewerClose method: input parameter "attachmentOption.open" is equal to true', () => {
// spyOn(viewerService, 'setAttachmentViewerState');
// component.displayAttachmentViewer = false;

// const attachmentOptionInput = { open: false };
// component.onAttachmentViewerClose(attachmentOptionInput);

// expect(viewerService.setAttachmentViewerState).toHaveBeenCalled();
// expect(component.displayAttachmentViewer).toEqual(false);
// });

// it('test onAttachmentViewerClose method: input parameter "attachmentOption.open" is equal to false', () => {
// spyOn(viewerService, 'setAttachmentViewerState');
// component.displayAttachmentViewer = true;

// const attachmentOptionInput = { open: false };
// component.onAttachmentViewerClose(attachmentOptionInput);

// expect(viewerService.setAttachmentViewerState).toHaveBeenCalled();
// expect(component.displayAttachmentViewer).toEqual(false);
// });


// it('test getDollarSignString method', () => {
// const result = component.getDollarSignString('\u2013\u2013\u2013');
// expect(result).toEqual('\u2013\u2013\u2013');
// });

// it('test displayMedicareInternalControlNumber method', () => {
// expect(component.claimType).toEqual(undefined);
// const result = component.displayMedicareInternalControlNumber();
// expect(result).toEqual(false);
// });

// it('test ngAfterViewInit method', () => {
// spyOn(billingMiscellanousService, 'getInstance');
// component.ngAfterViewInit();

// expect(billingMiscellanousService.getInstance).toHaveBeenCalled();
// expect(billingMiscellanousService.getInstance).toHaveBeenCalledWith(component);
// });

// it('test onAttachmentViewerClose method', () => {
// component.displayAttachmentViewer = undefined;
// spyOn(viewerService, 'setAttachmentViewerState');

// component.onAttachmentViewerClose({ open: true });

// expect(component.displayAttachmentViewer).toEqual(true);
// expect(viewerService.setAttachmentViewerState).toHaveBeenCalled();
// expect(viewerService.setAttachmentViewerState).toHaveBeenCalledWith(false);
// });

// });