@@ -77,9 +77,44 @@ export async function render<WrapperType = WrapperComponent>(
77
77
78
78
## Component RenderOptions
79
79
80
+ ### ` componentInputs `
81
+
82
+ An object to set ` @Input ` properties of the component . Uses ` setInput ` to set
83
+ the input property . Throws if the component property is not annotated with the
84
+ ` @Input ` attribute .
85
+
86
+ ** default ** : ` {} `
87
+
88
+ ** example ** :
89
+
90
+ ` ` ` typescript
91
+ await render(AppComponent, {
92
+ componentInputs: {
93
+ counterValue: 10,
94
+ },
95
+ })
96
+ ` ` `
97
+
98
+ ### ` componentOutputs `
99
+
100
+ An object to set ` @Output ` properties of the component .
101
+
102
+ ** default ** : ` {} `
103
+
104
+ ** example ** :
105
+
106
+ ` ` ` typescript
107
+ await render(AppComponent, {
108
+ componentOutputs: {
109
+ clicked: (value) => { ... }
110
+ }
111
+ })
112
+ ` ` `
113
+
80
114
### ` componentProperties `
81
115
82
- An object to set ` @Input ` and ` @Output ` properties of the component .
116
+ An object to set ` @Input ` and ` @Output ` properties of the component . Doesn ' t
117
+ have a fine - grained control as ` componentInputs ` and ` componentOutputs ` .
83
118
84
119
** default ** : ` {} `
85
120
@@ -88,12 +123,34 @@ An object to set `@Input` and `@Output` properties of the component.
88
123
` ` ` typescript
89
124
await render(AppComponent, {
90
125
componentProperties: {
126
+ // an input
91
127
counterValue: 10,
128
+ // an output
92
129
send: (value) => { ... }
130
+ // a public property
131
+ name: 'Tim'
93
132
}
94
133
})
95
134
` ` `
96
135
136
+ ### ` declarations `
137
+
138
+ A collection of components , directives and pipes needed to render the component .
139
+ For example , nested components of the component .
140
+
141
+ For more info see the
142
+ [Angular docs ](https :// angular.io/api/core/NgModule#declarations).
143
+
144
+ ** default ** : ` [] `
145
+
146
+ ** example ** :
147
+
148
+ ` ` ` typescript
149
+ await render(AppComponent, {
150
+ declarations: [CustomerDetailComponent, ButtonComponent],
151
+ })
152
+ ` ` `
153
+
97
154
### ` componentProviders `
98
155
99
156
A collection of providers needed to render the component via Dependency
@@ -115,50 +172,64 @@ await render(AppComponent, {
115
172
})
116
173
` ` `
117
174
118
- ### ` declarations `
175
+ ### ` componentImports `
119
176
120
- A collection of components , directives and pipes needed to render the component .
121
- For example , nested components of the component .
122
-
123
- For more info see the
124
- [Angular docs ](https :// angular.io/api/core/NgModule#declarations).
177
+ A collection of imports to override a standalone component ' s imports with.
125
178
126
- ** default ** : ` [] `
179
+ ** default ** : ` undefined `
127
180
128
181
** example ** :
129
182
130
183
` ` ` typescript
131
184
await render(AppComponent, {
132
- declarations : [CustomerDetailComponent, ButtonComponent ],
185
+ componentImports : [MockChildComponent ],
133
186
})
134
187
` ` `
135
188
136
- ### ` ɵcomponentImports `
189
+ ### ` childComponentOverrides `
137
190
138
- A collection of imports to override a standalone component ' s imports with.
191
+ Collection of child component specified providers to override with .
139
192
140
193
** default ** : ` undefined `
141
194
142
195
** example ** :
143
196
144
197
` ` ` typescript
145
198
await render(AppComponent, {
146
- ɵcomponentImports: [
147
- MockChildComponent
148
- ]
199
+ childComponentOverrides: [
200
+ {
201
+ component: ChildOfAppComponent,
202
+ providers: [{provide: ChildService, useValue: {hello: 'world'}}],
203
+ },
204
+ ],
149
205
})
150
206
` ` `
151
207
152
- ### ` detectChanges `
208
+ ### ` detectChangesOnRender `
153
209
154
- Will call ` detectChanges ` when the component is compiled
210
+ Invokes ` detectChanges ` after the component is rendered .
155
211
156
212
** default ** : ` true `
157
213
158
214
** example ** :
159
215
160
216
` ` ` typescript
161
- await render(AppComponent, {detectChanges: false})
217
+ await render(AppComponent, {detectChangesOnRender: false})
218
+ ` ` `
219
+
220
+ ### ` autoDetectChanges `
221
+
222
+ Automatically detect changes as a " real" running component would do . For
223
+ example , runs a change detection cycle when an event has occured .
224
+
225
+ ** default ** : ` true `
226
+
227
+ ** example ** :
228
+
229
+ ` ` ` typescript
230
+ await render(AppComponent, {
231
+ autoDetectChanges: false,
232
+ })
162
233
` ` `
163
234
164
235
### ` excludeComponentDeclaration `
0 commit comments