Allow Addons that affect img tags to be tested
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs-addons-test-utils': patch
|
||||
---
|
||||
|
||||
Fixed a bug preventing testing of TechDocs Addons whose dom contained `<img />` tags.
|
||||
@@ -46,6 +46,7 @@ const techdocsApi = {
|
||||
|
||||
const techdocsStorageApi = {
|
||||
getApiOrigin: jest.fn(),
|
||||
getBaseUrl: jest.fn(),
|
||||
getEntityDocs: jest.fn(),
|
||||
syncEntityDocs: jest.fn(),
|
||||
};
|
||||
@@ -180,7 +181,9 @@ export class TechDocsAddonTester {
|
||||
techdocsStorageApi.getApiOrigin.mockResolvedValue(
|
||||
'https://backstage.example.com/api/techdocs',
|
||||
);
|
||||
|
||||
techdocsStorageApi.getBaseUrl.mockResolvedValue(
|
||||
`https://backstage.example.com/api/techdocs/${entityName.namespace}/${entityName.kind}/${entityName.name}/${this.options.path}`,
|
||||
);
|
||||
techdocsStorageApi.getEntityDocs.mockResolvedValue(
|
||||
renderToStaticMarkup(this.options.dom || defaultDom),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user