'how to do renderer2.listen unit test for renderer.listen('window','click',event) in angular

cannot read properties of undefined attachcomponentportal error is coming in spec.ts file in angular How to solve this? this.portaloutlet undefined is coming



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source