Skip to content

Feature Request: built in function to check if a snippet is rendered #429

Closed
@AntonioVentilii

Description

@AntonioVentilii

Hello,

Is there a way to render a component, set the test conditions and then call something like expect(RenderedComponent).toRenderSnippet(...) or .not.toRenderSnippet(...)?

For example

it('should render the snippet if conditions are met', async () => {
                // this would be a new functions that auto-fills the children/props that are Snippet for example
		const {renderedComponent} = renderWithMockedSnippets(MyComponent);
		
                 // here the consumer sets the conditions to render the snippet (if it is conditional)
                ........

		expect(renderedComponent).toHaveSnippet(...)
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions