Skip to content

feat: support ngOnChanges with correct simpleChange object within rerender #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update projects/testing-library/tests/rerender.spec.ts
Co-authored-by: Tim Deschryver <[email protected]>
  • Loading branch information
shaman-apprentice and timdeschryver committed Feb 23, 2023
commit 66ba0c79048c831d5bd3836dc3db335f3b8e19d8
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