-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(focus-monitor): reenter ngzone before emitting #10549
Conversation
expect(buttonElement.innerText).toBe(''); | ||
buttonElement.focus(); | ||
fixture.detectChanges(); | ||
expect(buttonElement.innerText).toBe('program'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having the test go through change detection, you should be able to assert the same using NgZone
:
const spy = jasmine.createSpy('zone spy');
focusMonitor.monitor(element).subscribe(() => {
spy(NgZone.isInAngularZone());
});
expect(spy).toHaveBeenCalledWith(true);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat, didn't know that method existed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@andrewseguin I think we can just approve the screen diffs |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.