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 { MessagesComponent } from './messages.component';

describe('MessagesComponent', () => {
let component: MessagesComponent;

beforeEach(() => {
component = new MessagesComponent(null);

jasmine.clock().install();
});

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

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


it('test animate method: input parameter "key" equal to "ewvStatus" string and clock ticks greater than the timeout occur', () => {
component.animateClose = undefined;
component.errorStatus = undefined;
component.successStatus = undefined;
component.warningStatus = undefined;
component.infoStatus = undefined;
component.infoStatusSolid = undefined;
component.ewvStatus = undefined;

component.animate('ewvStatus', 100);
jasmine.clock().tick(101);

expect(component.animateClose).toEqual(false);
expect(component.errorStatus).toEqual(undefined);
expect(component.successStatus).toEqual(undefined);
expect(component.warningStatus).toEqual(undefined);
expect(component.infoStatus).toEqual(undefined);
expect(component.infoStatusSolid).toEqual(undefined);
expect(component.ewvStatus).toEqual(false);
});

it('test close method: input parameter "key" equals "ewvNoInfo" string', () => {
spyOn(component, 'animate');
component.close('ewvNoInfo');

expect(component.animate).toHaveBeenCalled();
expect(component.animate).toHaveBeenCalledWith('ewvNoInfo', component.animateFade);
});

});