File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed
docs/angular-testing-library Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change @@ -388,27 +388,6 @@ const {debug} = await render(AppComponent)
388388debug()
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
414393Create and render a new instance of the component . Input properties that are not
@@ -422,7 +401,7 @@ const {rerender} = await render(Counter, {
422401expect(screen.getByTestId('count-value').textContent).toBe('4')
423402expect(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
428407expect(screen.getByTestId('count-value').textContent).toBe('7')
You can’t perform that action at this time.
0 commit comments