Createa @backstage/plugin-catalog-common-react package
This commit is contained in:
@@ -14,23 +14,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-common-react';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import {
|
||||
lighthouseApiRef,
|
||||
LighthouseRestApi,
|
||||
WebsiteListResponse,
|
||||
} from '../../api';
|
||||
|
||||
import * as data from '../../__fixtures__/website-list-response.json';
|
||||
import { EntityContext } from '@backstage/plugin-catalog';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { AuditListForEntity } from './AuditListForEntity';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';
|
||||
import * as data from '../../__fixtures__/website-list-response.json';
|
||||
import { AuditListForEntity } from './AuditListForEntity';
|
||||
|
||||
jest.mock('../../hooks/useWebsiteForEntity', () => ({
|
||||
useWebsiteForEntity: jest.fn(),
|
||||
|
||||
@@ -14,21 +14,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-common-react';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import {
|
||||
AuditCompleted,
|
||||
LighthouseCategoryId,
|
||||
WebsiteListResponse,
|
||||
} from '../../api';
|
||||
import { EntityContext } from '@backstage/plugin-catalog';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { LastLighthouseAuditCard } from './LastLighthouseAuditCard';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import * as data from '../../__fixtures__/website-list-response.json';
|
||||
import { LastLighthouseAuditCard } from './LastLighthouseAuditCard';
|
||||
|
||||
jest.mock('../../hooks/useWebsiteForEntity', () => ({
|
||||
useWebsiteForEntity: jest.fn(),
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core';
|
||||
import { lighthouseApiRef, WebsiteListResponse } from '../api';
|
||||
import { useWebsiteForEntity } from './useWebsiteForEntity';
|
||||
import { EntityContext } from '@backstage/plugin-catalog';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core';
|
||||
import { EntityContext } from '@backstage/plugin-catalog-common-react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
import { lighthouseApiRef, WebsiteListResponse } from '../api';
|
||||
import * as data from '../__fixtures__/website-list-response.json';
|
||||
import { useWebsiteForEntity } from './useWebsiteForEntity';
|
||||
|
||||
const websiteListResponse = data as WebsiteListResponse;
|
||||
const website = websiteListResponse.items[0];
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { useEntity } from '@backstage/plugin-catalog';
|
||||
import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants';
|
||||
import { errorApiRef, useApi } from '@backstage/core';
|
||||
import { lighthouseApiRef } from '../api';
|
||||
import { useEntity } from '@backstage/plugin-catalog-common-react';
|
||||
import { useAsync } from 'react-use';
|
||||
import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants';
|
||||
import { lighthouseApiRef } from '../api';
|
||||
|
||||
// For the sake of simplicity we assume that an entity has only one website url. This is to avoid encoding a list
|
||||
// type in an annotation which is a plain string.
|
||||
|
||||
Reference in New Issue
Block a user