74 lines
2.0 KiB
JavaScript
74 lines
2.0 KiB
JavaScript
/**
|
|
* Created by mkumar1 on 09-05-2017.
|
|
*/
|
|
|
|
describe('Testing Person VO', function () {
|
|
|
|
var personVo;
|
|
|
|
it('should create object and test properties', function () {
|
|
|
|
personVo = new PersonVO();
|
|
|
|
expect(personVo.type).toEqual(EntityVO.TYPE_PERSON);
|
|
expect(personVo.firstName).toEqual("");
|
|
expect(personVo.lastName).toEqual("");
|
|
expect(personVo.fullName).toEqual("");
|
|
expect(personVo.department).toEqual("");
|
|
expect(personVo.email).toEqual("");
|
|
expect(personVo.company).toEqual(null);
|
|
expect(personVo.phone).toEqual("");
|
|
expect(personVo.thumbnailMime).toEqual("");
|
|
expect(personVo.thumbnail).toEqual("");
|
|
expect(personVo.site).toEqual(null);
|
|
expect(personVo.organization).toEqual("");
|
|
expect(personVo.loginId).toEqual("");
|
|
expect(personVo.available).toEqual("");
|
|
expect(personVo.jid).toEqual("");
|
|
expect(personVo.supportGroups).toEqual(null);
|
|
|
|
});
|
|
|
|
it('should test the inheritance with base', function() {
|
|
|
|
expect(personVo instanceof BaseVO).toBeTruthy();
|
|
|
|
});
|
|
|
|
it('should verify all the properties', function () {
|
|
|
|
var returnVal = personVo.getProps();
|
|
expect(returnVal).toEqual([ 'id', 'createDate', 'firstName', 'lastName', 'fullName', 'department', 'email', 'company', 'phone', 'thumbnailMime', 'thumbnail', 'site', 'organization', 'loginId', 'available', 'jid', 'supportGroups' ]);
|
|
|
|
});
|
|
|
|
it('should test the post build features', function () {
|
|
|
|
personVo.postBuild();
|
|
|
|
expect(personVo.supportGroup).not.toBeDefined();
|
|
expect(personVo.supportGroupId).not.toBeDefined();
|
|
expect(personVo.supportOrganization).not.toBeDefined();
|
|
|
|
personVo.supportGroups = [
|
|
{
|
|
"id" : "test100898",
|
|
"name" : "Allen",
|
|
"organization" : ""
|
|
}
|
|
];
|
|
|
|
personVo.postBuild();
|
|
|
|
expect(personVo.supportGroup).toEqual("Allen");
|
|
expect(personVo.supportGroupId).toEqual("test100898");
|
|
expect(personVo.supportOrganization).toEqual("");
|
|
|
|
personVo.supportGroups[0]['organization'] = "TestOrg";
|
|
|
|
personVo.postBuild();
|
|
|
|
expect(personVo.supportOrganization).toEqual("TestOrg");
|
|
|
|
});
|
|
}); |