You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, for MockRenderFactory this doesnt seem to be possible, ie for the following example in the docs, input1 is explicitly set, however for input2 it seems this input also receives an undefined value which overwrites the component's default value
constfactory=MockRenderFactory(MyComponent,['input1','input2']);
...
it('covers one case',()=>{constfixture=factory({input1: 1});expect(fixture.point.componentInstance.input1).toEqual(1);});
Also, if I am missing something please let me know.
Proposed solution
Would it be possible for cases like the above to keep the default value if the input value is not explicitly defined? ie for the case above input2 would not be set at all and the default value would be used, or no setters would be called in the component
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the feature or problem you'd like to solve
First of all, thanks for this great library, its really useful!
MockRender
supports providing an empty object, or omitting some params/inputs to allow default values to be used, ie see https://ng-mocks.sudo.eu/api/MockRender#empty-paramsHowever, for
MockRenderFactory
this doesnt seem to be possible, ie for the following example in the docs, input1 is explicitly set, however for input2 it seems this input also receives anundefined
value which overwrites the component's default valueAlso, if I am missing something please let me know.
Proposed solution
Would it be possible for cases like the above to keep the default value if the input value is not explicitly defined? ie for the case above
input2
would not be set at all and the default value would be used, or no setters would be called in the componentAdditional context
N/A
The text was updated successfully, but these errors were encountered: