I'm writing unit tests for a component that uses [innerHTML] to display content from backend. In the browser when the component is loaded, this warning "WARNING: sanitizing HTML stripped some content, see https://g.co/ng/security#xss thrown" is displayed in the console, but there's nothing preventing the component from behaving normally.
However, when I write any unit test for the component, even just testing if the component created and is truthy, the test is marked as failing due to this warning.
I know that the solution to removing that warning from the component is to alter the component to use a Data Pipe utilizing the DomSanitizer class -- but I'd prefer to move forward with writing the unit tests without altering the actual component itself. Is there any way I can avoid this warning only manipulating the test file? Something like catching this warning and accepting it, or some other solution that could prevent this warning from failing the entire test.
Thanks!