Skip to content

Feature Request: Support for InitialValues of Signal Inputs #11101

@StreetCube

Description

@StreetCube

Describe the feature or problem you'd like to solve

It seems like the ng-mocks library does not automatically apply default values to signal inputs when rendering components for testing. This means that even if a signal input has a default value set in the component (e.g., input(defaultValue)), it appears to be null in the test environment unless manually set. This behavior might not accurately reflect how the component would work in a real application, especially if the default value is removed from the component.

Proposed solution

If this behavior is indeed due to how ng-mocks handles signal inputs, it would be beneficial to implement a feature that automatically applies default values to signal inputs when rendering components for testing:

  • Tests would automatically fail if default values are removed from the component, ensuring that changes to default values are caught and it mimicks the component's behavior better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions