Skip to content

Commit ae4227a

Browse files
committed
look into tests
1 parent 788966a commit ae4227a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/components/HarborDashboardPage/HarborDashboardPage.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import '@testing-library/jest-dom';
55
import { HarborDashboardPage } from './HarborDashboardPage';
66
import { EntityProvider } from '@backstage/plugin-catalog-react';
77

8+
global.TextEncoder = require('util').TextEncoder;
9+
810
// Explicit mocks clearly set
911
jest.mock('../useHarborAppData', () => ({
1012
useHarborAppData: jest.fn(),

src/components/HarborWidget/HarborWidget.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { TestApiProvider } from '@backstage/test-utils';
77
import { EntityProvider } from '@backstage/plugin-catalog-react';
88
import { catalogApiRef } from '@backstage/plugin-catalog-react';
99
import { Entity } from '@backstage/catalog-model';
10+
global.TextEncoder = require('util').TextEncoder;
1011

1112
jest.mock('../useHarborAppData', () => ({
1213
useHarborAppData: jest.fn(),
@@ -32,6 +33,7 @@ jest.mock('@backstage/plugin-catalog-react', () => ({
3233

3334
import { useHarborAppData } from '../useHarborAppData';
3435
import { isHarborAvailable } from '../../plugin';
36+
import React from 'react';
3537

3638
describe('HarborWidget', () => {
3739
const entityWithAnnotation: Entity = {

0 commit comments

Comments
 (0)