Open sammaphey opened 5 years ago
Have you found a solution? If this issue is still open, take a look at formpropertyfactory.ts. Here you will also find an overview of the instantiatable derived classes.
One way to bypass this issue is to wrap your this.formProperty
into a getter, and then using jasmine to intercept the call, and inject the mocked value (with something like spyOn(myWidget, 'getFormProperty').and.returnValue(mockFormProperty as ArrayProperty);
for example)
I am attempting to test a custom widget and am running into problems regarding the formProperty.
-- component:
-- spec
-- error:
TypeError: Cannot read property 'value' of undefined
I believe that the error is coming from the components formProperty not being defined. I have attempted to mock it but FormProperty is an abstract class so I cannot do that.
Any suggestions?