org: fix entity card tests
This commit is contained in:
@@ -16,7 +16,11 @@
|
||||
|
||||
import { Entity, GroupEntity } from '@backstage/catalog-model';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core';
|
||||
import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react';
|
||||
import {
|
||||
CatalogApi,
|
||||
catalogApiRef,
|
||||
EntityProvider,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { MembersListCard } from './MembersListCard';
|
||||
@@ -78,7 +82,10 @@ describe('MemberTab Test', () => {
|
||||
const rendered = await renderWithEffects(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<MembersListCard entity={groupEntity} />
|
||||
<EntityProvider entity={groupEntity}>
|
||||
<MembersListCard />
|
||||
</EntityProvider>
|
||||
,
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { UserEntity } from '@backstage/catalog-model';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { UserProfileCard } from './UserProfileCard';
|
||||
@@ -48,7 +49,11 @@ describe('UserSummary Test', () => {
|
||||
|
||||
it('Display Profile Card', async () => {
|
||||
const rendered = await renderWithEffects(
|
||||
wrapInTestApp(<UserProfileCard entity={userEntity} variant="gridItem" />),
|
||||
wrapInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard entity={userEntity} variant="gridItem" />
|
||||
</EntityProvider>,
|
||||
),
|
||||
);
|
||||
|
||||
expect(rendered.getByText('calum-leavy@example.com')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user