TechDocsAddonTester
Home > @backstage/plugin-techdocs-addons-test-utils > TechDocsAddonTester
Utility class for rendering TechDocs Addons end-to-end within the TechDocs reader page, with a set of givens (e.g. page DOM, metadata, etc).
Signature:
class TechDocsAddonTester 
Example
const { getByText } = await TechDocsAddonTester.buildAddonsInTechDocs([<AnAddon />])
  .withDom(<body>TEST_CONTENT</body>)
  .renderWithEffects();
expect(getByText('TEST_CONTENT')).toBeInTheDocument();
Constructors
| Constructor | Modifiers | Description | 
|---|---|---|
| 
 | Constructs a new instance of the  | 
Methods
| Method | Modifiers | Description | 
|---|---|---|
| Provide the TechDocs page path at which the Addon is rendered (e.g. the part of the path after the entity namespace/kind/name). | ||
| Return a fully configured and mocked TechDocs reader page within a test App instance, using the given Addon(s). | ||
| 
 | Get a TechDocsAddonTester instance for a given set of Addons. | |
| Render the Addon within a fully configured and mocked TechDocs reader. | ||
| Provide mock API implementations if your Addon expects any. | ||
| Provide mock HTML if your Addon expects it in the shadow DOM. | ||
| Provide a mock entity if your Addon needs it. This also controls the base path at which the Addon is rendered. | ||
| Provide mock techdocs_metadata.json values if your Addon needs it. |