Skip to content

Commit fafc7fd

Browse files
authored
docs(angular-testing-library): update rerender api (#1249)
1 parent cec02ce commit fafc7fd

File tree

1 file changed

+1
-22
lines changed
  • docs/angular-testing-library

1 file changed

+1
-22
lines changed

docs/angular-testing-library/api.mdx

+1-22
Original file line numberDiff line numberDiff line change
@@ -388,27 +388,6 @@ const {debug} = await render(AppComponent)
388388
debug()
389389
```
390390

391-
### `change`
392-
393-
Change the input of the component. This calls `detectChanges` after the props
394-
are updated.
395-
396-
```typescript
397-
const {change} = await render(Counter, {
398-
componentProperties: {count: 4, name: 'Sarah'},
399-
})
400-
401-
expect(screen.getByTestId('count-value').textContent).toBe('4')
402-
expect(screen.getByTestId('name-value').textContent).toBe('Sarah')
403-
404-
change({count: 7})
405-
406-
// count updated to 7
407-
expect(screen.getByTestId('count-value').textContent).toBe('7')
408-
// name keeps the same value
409-
expect(screen.getByTestId('name-value').textContent).toBe('Sarah')
410-
```
411-
412391
### `rerender`
413392

414393
Create and render a new instance of the component. Input properties that are not
@@ -422,7 +401,7 @@ const {rerender} = await render(Counter, {
422401
expect(screen.getByTestId('count-value').textContent).toBe('4')
423402
expect(screen.getByTestId('name-value').textContent).toBe('Sarah')
424403
425-
await rerender({count: 7})
404+
await rerender({componentProperties: {count: 7}})
426405
427406
// count updated to 7
428407
expect(screen.getByTestId('count-value').textContent).toBe('7')

0 commit comments

Comments
 (0)