removed usages of EntityContext in tests and stories
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
+2
-6
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-react';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
import { useConsumerGroupsForEntity } from './useConsumerGroupsForEntity';
|
||||
@@ -23,11 +23,7 @@ describe('useConsumerGroupOffsets', () => {
|
||||
let entity: Entity;
|
||||
|
||||
const wrapper = ({ children }: PropsWithChildren<{}>) => {
|
||||
return (
|
||||
<EntityContext.Provider value={{ entity: entity, loading: false }}>
|
||||
{children}
|
||||
</EntityContext.Provider>
|
||||
);
|
||||
return <EntityProvider entity={entity}>{children}</EntityProvider>;
|
||||
};
|
||||
|
||||
const subject = () => renderHook(useConsumerGroupsForEntity, { wrapper });
|
||||
|
||||
+2
-4
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-react';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { when } from 'jest-when';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
@@ -65,9 +65,7 @@ describe('useConsumerGroupOffsets', () => {
|
||||
mockKafkaApi,
|
||||
)}
|
||||
>
|
||||
<EntityContext.Provider value={{ entity: entity, loading: false }}>
|
||||
{children}
|
||||
</EntityContext.Provider>
|
||||
<EntityProvider entity={entity}>{children}</EntityProvider>
|
||||
</ApiProvider>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user