i'm new in unit testing in angular actually i facing a issue while initialization of form group
it('should be able to init forms', () => {
service.organizationForm = formBuilder.group({})
service.initOrganizationForm()
})
while initOrganizationForm function is called in this function there is catch
this.organizationForm.valueChanges.
subscribe(form => {
this.organizationButtonsData[1]['disabled'] = this.organizationForm.valid ? false : true;
this.getRequiredCount();
});
so becuase of this code i am getting this error
should be able to init forms
Setting Management Service
TypeError: Cannot read property 'valueChanges' of undefined
at <Jasmine>
at SettingManagementService.valueChanges [as initOrganizationForm] (http://localhost:9876/_karma_webpack_/src/app/core/services/settings.management.service.ts:465:31)
at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/src/app/core/services/settings.management.service.spec.ts:74:17)