53 lines
1.4 KiB
JavaScript
53 lines
1.4 KiB
JavaScript
/**
|
|
* Created by abhatkha on 5/8/17.
|
|
*/
|
|
//This is test suite for baseVO
|
|
|
|
describe("Test RelatedObjectVO", function() {
|
|
|
|
var relatedObj;
|
|
it(" should create object ", function() {
|
|
|
|
relatedObj = new RelatedObjectVO();
|
|
expect(relatedObj instanceof BaseVO).toEqual(true);
|
|
expect(relatedObj instanceof RelatedObjectVO).toEqual(true);
|
|
|
|
});
|
|
|
|
it(" should initilize objects with all properties ", function() {
|
|
|
|
var relatedObjProp= relatedObj.getProps();
|
|
|
|
expect(relatedObjProp).toEqual(['id', 'createDate','displayId', 'type', 'title', 'classId','eventType']);
|
|
|
|
expect(relatedObj.id).not.toBeDefined();
|
|
expect(relatedObj.createDate).not.toBeDefined();
|
|
|
|
expect(relatedObj.displayId).toEqual('');
|
|
expect(relatedObj.type).toEqual('');
|
|
expect(relatedObj.title).toEqual('');
|
|
expect(relatedObj.classId).toEqual('');
|
|
expect(relatedObj.eventType).toEqual('');
|
|
expect(relatedObj.showHeader).toBeTruthy();
|
|
expect(relatedObj.entityLink).toEqual('');
|
|
|
|
});
|
|
|
|
it(" should return boolean isAsset method ", function() {
|
|
|
|
expect(relatedObj.isAsset()).toBeFalsy();
|
|
|
|
relatedObj.type = EntityVO.TYPE_ASSET;
|
|
expect(relatedObj.isAsset()).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
it(" should run postBuild method ", function() {
|
|
|
|
relatedObj.postBuild();
|
|
|
|
relatedObj.type = '';
|
|
relatedObj.postBuild();
|
|
});
|
|
}); |