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 { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
import { OhiClaimAdjustmentsComponent } from './ohi-claim-adjustments.component';
import { OhiClaimAdjustmentsService } from './ohi-claim-adjustments.service';
describe('OhiClaimAdjustmentsComponent', () => {
let component: OhiClaimAdjustmentsComponent;
let ewvViewerService: EwvViewerService;
let ohiClaimAdjustmentsService: OhiClaimAdjustmentsService;
beforeEach(() => {
ewvViewerService = new EwvViewerService(null, null);
ohiClaimAdjustmentsService = new OhiClaimAdjustmentsService();
component = new OhiClaimAdjustmentsComponent(ewvViewerService);
});
it('should be created', () => {
expect(component).toBeTruthy();
});
it('test populateData method', () => {
const detailServiceLineOhiOutputRowsData = { theData: 'DATA' };
component.data = {
detailServiceLineOhiOutputRows: detailServiceLineOhiOutputRowsData
};
expect(component.ohiSrvcLineAdjInfo).toEqual(undefined);
component.populateData();
expect(component.ohiSrvcLineAdjInfo).toEqual(
detailServiceLineOhiOutputRowsData
);
});
it('test populateData method', () => {
component.data = {
claimOhiList: [
{
claimOhiHeaderBean: { paymentSequenceIndicator: 'DUMMY' }
},
{
claimOhiHeaderBean: { paymentSequenceIndicator: 'DUMMY' }
}
]
};
// expect(component.tableSettings.pagination).toEqual(true);
expect(component.primaryOhiInfo).toEqual(null);
expect(component.primaryClaimAdjustmentsTableInfoRows).toEqual([]);
expect(component.secondaryOhiInfo).toEqual(null);
expect(component.secondaryClaimAdjustmentsTableInfoRows).toEqual([]);
expect(component.tertiaryOhiInfo).toEqual(null);
expect(component.tertiaryClaimAdjustmentsTableInfoRows).toEqual([]);
component.populateData();
// expect(component.tableSettings.pagination).toEqual(false);
expect(component.primaryOhiInfo).toEqual(null);
expect(component.primaryClaimAdjustmentsTableInfoRows).toEqual([]);
expect(component.secondaryOhiInfo).toEqual(null);
expect(component.secondaryClaimAdjustmentsTableInfoRows).toEqual([]);
expect(component.tertiaryOhiInfo).toEqual(null);
expect(component.tertiaryClaimAdjustmentsTableInfoRows).toEqual([]);
});
it('test ngOnChanges method', () => {
spyOn(component, 'populateData');
expect(component.data).toEqual(undefined);
let changes;
changes = {
data: {
currentValue: 'CURRENT_VALUE'
}
};
component.ngOnChanges(changes);
expect(component.data).toEqual('CURRENT_VALUE');
expect(component.populateData).toHaveBeenCalled();
});
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 getPercentageString method', () => {
const result = component.getPercentageString('22.23');
expect(result).toEqual('22.23%');
});
it('test doesValueExist method', () => {
const result = component.doesValueExist('Value');
expect(result).toEqual(true);
});
// it('test ngAfterViewInit method', () => {
// spyOn(ohiClaimAdjustmentsService, 'getInstance');
// component.ngAfterViewInit();
// expect(ohiClaimAdjustmentsService.getInstance).toHaveBeenCalled();
// expect(ohiClaimAdjustmentsService.getInstance).toHaveBeenCalledWith(component);
// });
});