@backstage/frontend-test-utils 0.1.12 → 0.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/app/createExtensionTester.esm.js +10 -103
- package/dist/app/createExtensionTester.esm.js.map +1 -1
- package/dist/app/renderInTestApp.esm.js +44 -39
- package/dist/app/renderInTestApp.esm.js.map +1 -1
- package/dist/frontend-app-api/src/tree/instantiateAppNodeTree.esm.js +8 -5
- package/dist/frontend-app-api/src/tree/instantiateAppNodeTree.esm.js.map +1 -1
- package/dist/frontend-app-api/src/tree/resolveAppNodeSpecs.esm.js +42 -5
- package/dist/frontend-app-api/src/tree/resolveAppNodeSpecs.esm.js.map +1 -1
- package/dist/frontend-app-api/src/tree/resolveAppTree.esm.js +40 -20
- package/dist/frontend-app-api/src/tree/resolveAppTree.esm.js.map +1 -1
- package/dist/frontend-plugin-api/src/wiring/createExtension.esm.js.map +1 -1
- package/dist/frontend-plugin-api/src/wiring/createExtensionOverrides.esm.js.map +1 -1
- package/dist/frontend-plugin-api/src/wiring/createFrontendModule.esm.js +25 -0
- package/dist/frontend-plugin-api/src/wiring/createFrontendModule.esm.js.map +1 -0
- package/dist/frontend-plugin-api/src/wiring/createFrontendPlugin.esm.js +10 -3
- package/dist/frontend-plugin-api/src/wiring/createFrontendPlugin.esm.js.map +1 -1
- package/dist/frontend-plugin-api/src/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/dist/index.d.ts +16 -13
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export { ErrorWithContext, MockConfigApi, MockErrorApi, MockErrorApiOptions, MockFetchApi, MockFetchApiOptions, MockPermissionApi, MockStorageApi, MockStorageBucket, TestApiProvider, TestApiProviderProps, TestApiRegistry, registerMswTestHooks, withLogCollector } from '@backstage/test-utils';
|
|
3
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
4
|
-
import { AnalyticsApi, AnalyticsEvent, AnyExtensionDataRef, AppNode, ExtensionDataRef, ExtensionDefinition, RouteRef } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { AnalyticsApi, AnalyticsEvent, AnyExtensionDataRef, AppNode, ExtensionDataRef, ExtensionDefinitionParameters, ExtensionDefinition, RouteRef } from '@backstage/frontend-plugin-api';
|
|
5
|
+
import { FrontendFeature } from '@backstage/frontend-app-api';
|
|
5
6
|
import { RenderResult } from '@testing-library/react';
|
|
6
7
|
import { JsonObject } from '@backstage/types';
|
|
7
8
|
|
|
@@ -38,23 +39,17 @@ declare class ExtensionQuery<UOutput extends AnyExtensionDataRef> {
|
|
|
38
39
|
/** @public */
|
|
39
40
|
declare class ExtensionTester<UOutput extends AnyExtensionDataRef> {
|
|
40
41
|
#private;
|
|
41
|
-
add<
|
|
42
|
-
config?:
|
|
42
|
+
add<T extends ExtensionDefinitionParameters>(extension: ExtensionDefinition<T>, options?: {
|
|
43
|
+
config?: T['configInput'];
|
|
43
44
|
}): ExtensionTester<UOutput>;
|
|
44
45
|
get<TId extends UOutput['id']>(ref: ExtensionDataRef<any, TId, any>): UOutput extends ExtensionDataRef<infer IData, TId, infer IConfig> ? IConfig['optional'] extends true ? IData | undefined : IData : never;
|
|
45
|
-
query<
|
|
46
|
+
query<T extends ExtensionDefinitionParameters>(extension: ExtensionDefinition<T>): ExtensionQuery<NonNullable<T['output']>>;
|
|
46
47
|
reactElement(): JSX.Element;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated Switch to using `renderInTestApp` directly and using `.reactElement()` or `.get(...)` to get the component you w
|
|
49
|
-
*/
|
|
50
|
-
render(options?: {
|
|
51
|
-
config?: JsonObject;
|
|
52
|
-
}): RenderResult;
|
|
53
48
|
}
|
|
54
49
|
/** @public */
|
|
55
|
-
declare function createExtensionTester<
|
|
56
|
-
config?:
|
|
57
|
-
}): ExtensionTester<
|
|
50
|
+
declare function createExtensionTester<T extends ExtensionDefinitionParameters>(subject: ExtensionDefinition<T>, options?: {
|
|
51
|
+
config?: T['configInput'];
|
|
52
|
+
}): ExtensionTester<NonNullable<T['output']>>;
|
|
58
53
|
|
|
59
54
|
/**
|
|
60
55
|
* Options to customize the behavior of the test app.
|
|
@@ -84,6 +79,14 @@ type TestAppOptions = {
|
|
|
84
79
|
* Additional configuration passed to the app when rendering elements inside it.
|
|
85
80
|
*/
|
|
86
81
|
config?: JsonObject;
|
|
82
|
+
/**
|
|
83
|
+
* Additional extensions to add to the test app.
|
|
84
|
+
*/
|
|
85
|
+
extensions?: ExtensionDefinition<any>[];
|
|
86
|
+
/**
|
|
87
|
+
* Additional features to add to the test app.
|
|
88
|
+
*/
|
|
89
|
+
features?: FrontendFeature[];
|
|
87
90
|
};
|
|
88
91
|
/**
|
|
89
92
|
* @public
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/frontend-test-utils",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.0-next.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -32,13 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@backstage/config": "^1.2.0",
|
|
35
|
-
"@backstage/frontend-app-api": "^0.
|
|
36
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
37
|
-
"@backstage/
|
|
35
|
+
"@backstage/frontend-app-api": "^0.9.0-next.1",
|
|
36
|
+
"@backstage/frontend-plugin-api": "^0.8.0-next.1",
|
|
37
|
+
"@backstage/plugin-app": "^0.1.0-next.1",
|
|
38
|
+
"@backstage/test-utils": "^1.6.0-next.0",
|
|
38
39
|
"@backstage/types": "^1.1.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@backstage/cli": "^0.27.
|
|
42
|
+
"@backstage/cli": "^0.27.1-next.1",
|
|
42
43
|
"@testing-library/jest-dom": "^6.0.0",
|
|
43
44
|
"@types/react": "*"
|
|
44
45
|
},
|