Skip to main content

TechDocsAddonTester.renderWithEffects()

Home > @backstage/plugin-techdocs-addons-test-utils > TechDocsAddonTester > renderWithEffects

Render the Addon within a fully configured and mocked TechDocs reader.

Signature:

renderWithEffects(): Promise<typeof screen & {
shadowRoot: ShadowRoot | null;
}>;

Returns:

Promise<typeof screen & { shadowRoot: ShadowRoot | null; }>

Remarks

Components using useEffect to perform an asynchronous action (such as fetch) must be rendered within an async act call to properly get the final state, even with mocked responses. This utility method makes the signature a bit cleaner, since act doesn't return the result of the evaluated function.