Skip to content

Commit c6be9bf

Browse files
committed
feat: rename ɵcomponentImports to componentImports
BREAKING CHANGE: The render property ɵcomponentImports is not experimental anymore, and is renamed to componentImports BEFORE: render(ParentComponent, { ɵcomponentImports: [ChildComponent], }); AFTER: render(ParentComponent, { componentImports: [ChildComponent], });
1 parent 198b75e commit c6be9bf

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

projects/testing-library/src/lib/models.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,12 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
215215
*
216216
* @example
217217
* const component = await render(AppComponent, {
218-
* ɵcomponentImports: [
218+
* componentImports: [
219219
* MockChildComponent
220220
* ]
221221
* })
222-
*
223-
* @experimental
224222
*/
225-
ɵcomponentImports?: (Type<any> | any[])[];
223+
componentImports?: (Type<any> | any[])[];
226224
/**
227225
* @description
228226
* Queries to bind. Overrides the default set from DOM Testing Library unless merged.

projects/testing-library/src/lib/testing-library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function render<SutType, WrapperType = SutType>(
5656
componentProperties = {},
5757
componentProviders = [],
5858
childComponentOverrides = [],
59-
ɵcomponentImports: componentImports,
59+
componentImports: componentImports,
6060
excludeComponentDeclaration = false,
6161
routes = [],
6262
removeAngularAttributes = false,

projects/testing-library/tests/render.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ describe('standalone with child', () => {
7979
expect(screen.getByText('A child fixture')).toBeInTheDocument();
8080
});
8181

82-
it('renders the standalone component with child given ɵcomponentImports', async () => {
83-
await render(ParentFixtureComponent, { ɵcomponentImports: [MockChildFixtureComponent] });
82+
it('renders the standalone component with a mocked child', async () => {
83+
await render(ParentFixtureComponent, { componentImports: [MockChildFixtureComponent] });
8484
expect(screen.getByText('Parent fixture')).toBeInTheDocument();
8585
expect(screen.getByText('A mock child fixture')).toBeInTheDocument();
8686
});
8787

8888
it('rejects render of template with componentImports set', () => {
8989
const view = render(`<div><atl-parent-fixture></atl-parent-fixture></div>`, {
9090
imports: [ParentFixtureComponent],
91-
ɵcomponentImports: [MockChildFixtureComponent],
91+
componentImports: [MockChildFixtureComponent],
9292
});
9393
return expect(view).rejects.toMatchObject({ message: /Error while rendering/ });
9494
});

0 commit comments

Comments
 (0)