feat(TechDocs): update <TechDocsCustomHome /> to support the new <DocsTable /> component
Signed-off-by: Yingbai He <yingbai.he@mycase.com>
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
||||
import {
|
||||
catalogApiRef,
|
||||
starredEntitiesApiRef,
|
||||
MockStarredEntitiesApi,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils';
|
||||
import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
|
||||
import { screen } from '@testing-library/react';
|
||||
@@ -37,7 +41,10 @@ const mockCatalogApi = catalogApiMock({
|
||||
});
|
||||
|
||||
describe('TechDocsCustomHome', () => {
|
||||
const apiRegistry = TestApiRegistry.from([catalogApiRef, mockCatalogApi]);
|
||||
const apiRegistry = TestApiRegistry.from(
|
||||
[catalogApiRef, mockCatalogApi],
|
||||
[starredEntitiesApiRef, new MockStarredEntitiesApi()],
|
||||
);
|
||||
|
||||
it('should render a TechDocs home page', async () => {
|
||||
const tabsConfig = [
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
catalogApiRef,
|
||||
CatalogApi,
|
||||
useEntityOwnership,
|
||||
EntityListProvider,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { DocsTable } from './Tables';
|
||||
@@ -127,7 +128,9 @@ const CustomPanel = ({
|
||||
) : null}
|
||||
</ContentHeader>
|
||||
<div className={classes.panelContainer}>
|
||||
<Panel data-testid="techdocs-custom-panel" entities={shownEntities} />
|
||||
<EntityListProvider>
|
||||
<Panel data-testid="techdocs-custom-panel" entities={shownEntities} />
|
||||
</EntityListProvider>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user