diff --git a/packages/markdown/parseMarkdown.js b/packages/markdown/parseMarkdown.js index 5de9eaf295b47e..9c01203713c219 100644 --- a/packages/markdown/parseMarkdown.js +++ b/packages/markdown/parseMarkdown.js @@ -370,7 +370,7 @@ function createRender(context) { return render; } -const BaseUIReexportedComponents = ['ClickAwayListener']; +const BaseUIReexportedComponents = ['ClickAwayListener', 'NoSsr', 'Portal', 'TextareaAutosize']; /** * @param {string} product diff --git a/test/e2e-website/material-docs.spec.ts b/test/e2e-website/material-docs.spec.ts index 1439ee0af35c93..768834b5a4c756 100644 --- a/test/e2e-website/material-docs.spec.ts +++ b/test/e2e-website/material-docs.spec.ts @@ -112,16 +112,23 @@ test.describe('Material docs', () => { await expect(firstAnchor).toHaveAttribute('href', '/material-ui/api/button/'); }); - test('should have correct API links when linking Base UI components', async ({ page }) => { - await page.goto('/material-ui/react-click-away-listener/'); - - const anchors = page.locator('div > h2#api ~ ul a'); - - const firstAnchor = anchors.first(); - const textContent = await firstAnchor.textContent(); - - await expect(textContent).toEqual(''); - await expect(firstAnchor).toHaveAttribute('href', '/base/api/click-away-listener/'); + ['ClickAwayListener', 'NoSsr', 'Portal', 'TextareaAutosize'].forEach((component) => { + test(`should have correct API link when linking Base UI component ${component}`, async ({ + page, + }) => { + await page.goto(`/material-ui/react-${kebabCase(component || '')}/`); + + const anchors = page.locator('div > h2#api ~ ul a'); + + const firstAnchor = anchors.first(); + const textContent = await firstAnchor.textContent(); + + await expect(textContent).toEqual(`<${component} />`); + await expect(firstAnchor).toHaveAttribute( + 'href', + `/base/api/${kebabCase(component || '')}/`, + ); + }); }); });