@@ -38,7 +38,8 @@ await render(AppComponent)
38
38
Instead of passing the component's type as first argument, you can also provide
39
39
a template. This practice is required to render directives but can also be
40
40
applied to components, it might even be more useful. The directive's (or
41
- component's) type must then be added to the ` declarations ` .
41
+ component's) type must then be added to the ` imports ` (or ` declarations ` in case
42
+ of non-standalone components).
42
43
43
44
** example with directive** :
44
45
@@ -103,12 +104,17 @@ the component.
103
104
` ` ` ts
104
105
// using a manual callback
105
106
const sendValue = (value) => { ... }
107
+ await render(AppComponent, {
108
+ on: {
109
+ send: (value) => sendValue(value),
110
+ }
111
+ })
112
+
106
113
// using a (jest) spy
107
114
const sendValueSpy = jest.fn()
108
115
109
116
await render(AppComponent, {
110
117
on: {
111
- send: (value) => sendValue(value),
112
118
send: sendValueSpy
113
119
}
114
120
})
@@ -120,7 +126,7 @@ A collection of components, directives and pipes needed to render the component.
120
126
For example , nested components of the component .
121
127
122
128
For more info see the
123
- [Angular docs ](https :// angular.io/api/core/NgModule #declarations).
129
+ [Angular docs ](https :// angular.dev/guide/ngmodules/overview #declarations).
124
130
125
131
** default ** : ` [] `
126
132
@@ -137,7 +143,7 @@ await render(AppComponent, {
137
143
Set the defer blocks behavior .
138
144
139
145
For more info see the
140
- [Angular docs ](https :// angular.io /api/core/testing/DeferBlockBehavior)
146
+ [Angular docs ](https :// angular.dev /api/core/testing/DeferBlockBehavior)
141
147
142
148
** default ** : ` undefined ` (uses ` DeferBlockBehavior.Manual ` , which is different
143
149
from the Angular default of ` DeferBlockBehavior.Playthrough ` )
@@ -155,7 +161,7 @@ await render(AppComponent, {
155
161
Set the initial state of a deferrable blocks in a component .
156
162
157
163
For more info see the
158
- [Angular docs ](https :// angular.io /api/core/testing/DeferBlockState)
164
+ [Angular docs ](https :// angular.dev /api/core/testing/DeferBlockState)
159
165
160
166
** default ** : ` undefined ` (uses the Angular default , which is
161
167
` DeferBlockState.Placeholder ` )
@@ -177,7 +183,7 @@ These will be provided at the component level. To inject dependencies at the
177
183
module level , use [` providers ` ](#providers ).
178
184
179
185
For more info see the
180
- [Angular docs ](https :// angular.io/api/core/Directive#providers ).
186
+ [Angular docs ](https :// angular.dev/guide/di/hierarchical-dependency-injection#example-providing-services-in-component ).
181
187
182
188
** default ** : ` [] `
183
189
@@ -273,7 +279,7 @@ modules. Adds `NoopAnimationsModule` by default if `BrowserAnimationsModule`
273
279
isn ' t added to the collection
274
280
275
281
For more info see the
276
- [Angular docs ](https :// angular.io/api/core/NgModule #imports).
282
+ [Angular docs ](https :// angular.dev/guide/components #imports-in-the-component-decorator ).
277
283
278
284
** default ** : ` [NoopAnimationsModule] `
279
285
@@ -294,7 +300,7 @@ These will be provided at the module level. To inject dependencies at the
294
300
component level , use [` componentProviders ` ](#componentProviders ).
295
301
296
302
For more info see the
297
- [Angular docs ](https :// angular.io/api/core/NgModule# providers).
303
+ [Angular docs ](https :// angular.dev/guide/di/dependency-injection- providers# ).
298
304
299
305
** default ** : ` [] `
300
306
@@ -331,7 +337,7 @@ await render(AppComponent, {
331
337
332
338
The route configuration to set up the router service via
333
339
` RouterTestingModule.withRoutes ` . For more info see the
334
- [Angular Routes docs ](https :// angular.io /api/router/Routes).
340
+ [Angular Routes docs ](https :// angular.dev /api/router/Routes).
335
341
336
342
** default ** : ` [] `
337
343
@@ -360,7 +366,7 @@ A collection of schemas needed to render the component. Allowed values are
360
366
` NO_ERRORS_SCHEMA ` and ` CUSTOM_ELEMENTS_SCHEMA ` .
361
367
362
368
For more info see the
363
- [Angular docs ](https :// angular.io/api/core/NgModule# schemas).
369
+ [Angular docs ](https :// angular.dev/guide/components/advanced-configuration#custom-element- schemas).
364
370
365
371
** default ** : ` [] `
366
372
@@ -511,20 +517,20 @@ expect(screen.getByTestId('name-value').textContent).toBe('Sarah')
511
517
Trigger a change detection cycle for the component .
512
518
513
519
For more info see the
514
- [Angular docs ](https :// angular.io /api/core/testing/ComponentFixture#detectChanges).
520
+ [Angular docs ](https :// angular.dev /api/core/testing/ComponentFixture#detectChanges).
515
521
516
522
### ` debugElement `
517
523
518
524
The Angular ` DebugElement ` of the component .
519
525
520
- For more info see the [Angular docs ](https :// angular.io /api/core/DebugElement).
526
+ For more info see the [Angular docs ](https :// angular.dev /api/core/DebugElement).
521
527
522
528
### ` fixture `
523
529
524
530
The Angular ` ComponentFixture ` of the component .
525
531
526
532
For more info see the
527
- [Angular docs ](https :// angular.io /api/core/testing/ComponentFixture).
533
+ [Angular docs ](https :// angular.dev /api/core/testing/ComponentFixture).
528
534
529
535
` ` ` typescript
530
536
const {fixture} = await render(AppComponent)
0 commit comments