-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Fixing memory leak for expansion-panel (#8403) #8410
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
Conversation
| } | ||
|
|
||
| ngOnDestroy() { | ||
| super.ngOnDestroy(); |
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.
Can you add a unit test for this change?
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.
I really tried to come up with a unit test, but I have not written unit tests for Jasmin/Karma before so I didnt really get it to work.
This is what I came up with but chrome hangs during execution:
it('make sure accordion item runs ngOnDestroy when expansion panel is destroyed', () => {
let fixture = TestBed.createComponent(PanelWithContent);
spyOn(fixture.componentInstance.panel.destroyed, 'emit');
fixture.componentInstance.panel.ngOnDestroy();
fixture.detectChanges();
expect(fixture.componentInstance.panel.destroyed.emit).toHaveBeenCalled();
});
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.
Ok, so I think I managed to make a correct unit test finally.
josephperrott
left a comment
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
|
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. |
This pull request is to replace (#8404), please check this for more information.