Skip to content

Commit

Permalink
Update projects/testing-library/tests/rerender.spec.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Deschryver <[email protected]>
  • Loading branch information
shaman-apprentice and timdeschryver committed Feb 23, 2023
1 parent e4acbbd commit 66ba0c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/testing-library/tests/rerender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ test('rerenders the component with updated props and resets other props', async
const firstName2 = 'Chris';
await rerender({ componentProperties: { firstName: firstName2 } });

expect(screen.getByText(`${firstName2}`)).toBeInTheDocument();
expect(screen.queryByText(`${firstName2} ${lastName}`)).not.toBeInTheDocument();
expect(screen.queryByText(`${firstName} ${lastName}`)).not.toBeInTheDocument();
expect(screen.getByText(firstName2)).toBeInTheDocument();
expect(screen.queryByText(firstName)).not.toBeInTheDocument();
expect(screen.queryByText(lastName)).not.toBeInTheDocument();

expect(ngOnChangesSpy).toHaveBeenCalledTimes(2); // one time initially and one time for rerender
const rerenderedChanges = ngOnChangesSpy.mock.calls[1][0] as SimpleChanges;
Expand Down

0 comments on commit 66ba0c7

Please sign in to comment.