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 { MiscellaneousInfoComponent } from './miscellaneous-info.component';
import { EwvViewerService } from '../../ewv-viewer/ewv-viewer.service';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

describe('MiscellaneousInfoComponent', () => {
let component: MiscellaneousInfoComponent;
let ewvViewerService: EwvViewerService;

beforeEach(() => {
ewvViewerService = new EwvViewerService(null, null);
component = new MiscellaneousInfoComponent(ewvViewerService, null);
jasmine.clock().install();
});

afterEach(function() {
jasmine.clock().uninstall();
});

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

it('test ngAfterViewInit method', () => {
expect(component.data).toEqual(undefined);
ewvViewerService.subject = new BehaviorSubject<boolean>(false);
expect(component.collapseState).toEqual(true);
spyOn(component, 'populateData');

component.ngAfterViewInit();

expect(component.collapseState).toEqual(true);
expect(component.populateData).not.toHaveBeenCalled();
});

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

component.populateData();

expect(component.isSplitView).toEqual(false);
});

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

let changes;
changes = {
data: {
// currentValue: 'CURRENT_VALUE'
}
};

component.ngOnChanges(changes);
jasmine.clock().tick(1);

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

it('test ngOnDestroy method', () => {
spyOn(component.isSplitSubscription, 'unsubscribe');

component.ngOnDestroy();

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

});