refactor(frontend-test-utils): remove components dependency
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/frontend-app-api": "workspace:^",
|
||||
"@backstage/frontend-plugin-api": "workspace:^",
|
||||
"@backstage/test-utils": "workspace:^",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import {
|
||||
analyticsApiRef,
|
||||
@@ -27,7 +28,6 @@ import {
|
||||
useAnalytics,
|
||||
useApi,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { Link } from '@backstage/core-components';
|
||||
import { MockAnalyticsApi } from '../apis';
|
||||
import { createExtensionTester } from './createExtensionTester';
|
||||
|
||||
@@ -175,7 +175,7 @@ describe('createExtensionTester', () => {
|
||||
).resolves.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should capture click events in anylitics', async () => {
|
||||
it('should capture click events in analytics', async () => {
|
||||
// Mocking the analytics api implementation
|
||||
const analyticsApiMock = new MockAnalyticsApi();
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
|
||||
import React, { ComponentType, ReactNode, useContext, useState } from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { Link } from '@backstage/core-components';
|
||||
import { MemoryRouter, Link } from 'react-router-dom';
|
||||
import { RenderResult, render } from '@testing-library/react';
|
||||
import { createSpecializedApp } from '@backstage/frontend-app-api';
|
||||
import {
|
||||
@@ -40,7 +39,7 @@ import { resolveExtensionDefinition } from '../../../frontend-plugin-api/src/wir
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
import { createSignInPageExtension } from '../../../frontend-plugin-api/src/extensions/createSignInPageExtension';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
import { InternalExtensionDefinition } from '../../../frontend-plugin-api/src/wiring/createExtension';
|
||||
import { toInternalExtensionDefinition } from '../../../frontend-plugin-api/src/wiring/createExtension';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
import { InternalAppContext } from '../../../frontend-app-api/src/wiring/InternalAppContext';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
@@ -195,8 +194,7 @@ export class ExtensionTester {
|
||||
options?: { config?: TConfig },
|
||||
): ExtensionTester {
|
||||
const tester = new ExtensionTester();
|
||||
const { output, factory, ...rest } =
|
||||
subject as InternalExtensionDefinition<TConfig>;
|
||||
const { output, factory, ...rest } = toInternalExtensionDefinition(subject);
|
||||
// attaching to core/routes to render as index route
|
||||
const extension = createExtension({
|
||||
...rest,
|
||||
|
||||
@@ -4227,7 +4227,6 @@ __metadata:
|
||||
resolution: "@backstage/frontend-test-utils@workspace:packages/frontend-test-utils"
|
||||
dependencies:
|
||||
"@backstage/cli": "workspace:^"
|
||||
"@backstage/core-components": "workspace:^"
|
||||
"@backstage/frontend-app-api": "workspace:^"
|
||||
"@backstage/frontend-plugin-api": "workspace:^"
|
||||
"@backstage/test-utils": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user