diff --git a/.changeset/techdocs-loose-seal-blooth.md b/.changeset/techdocs-loose-seal-blooth.md new file mode 100644 index 0000000000..fc6e809077 --- /dev/null +++ b/.changeset/techdocs-loose-seal-blooth.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-addons-test-utils': patch +--- + +Fixed a bug preventing testing of TechDocs Addons whose dom contained `` tags. diff --git a/plugins/techdocs-addons-test-utils/src/test-utils.tsx b/plugins/techdocs-addons-test-utils/src/test-utils.tsx index bc96dc365f..9d668eaf3d 100644 --- a/plugins/techdocs-addons-test-utils/src/test-utils.tsx +++ b/plugins/techdocs-addons-test-utils/src/test-utils.tsx @@ -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), );