How to dynamically create an Iframe in jasmine and test it?
<p>I need to dynamically create an iframe with some HTML and test it with Jasmine.<br>
This is a way how I create an Iframe - <a href="https://stackoverflow.com/questions/10418644/creating-an-iframe-with-given-html-dynamically">Creating an iframe with given HTML dynamically</a></p>

<pre><code>var iframe;
beforeEach(() =&gt; {
    iframe = document.createElement('iframe');
    var html = '&lt;body&gt;&lt;div class="bar"&gt;Foo&lt;/div&gt;&lt;/body&gt;';
    document.body.appendChild(iframe);
    iframe.contentWindow.document.open();
    iframe.contentWindow.document.write(html);
    iframe.contentWindow.document.close();
});
</code></pre>

<p>But there is no content created inside that iframe:</p>

<pre><code>it('working with IFRAME',
    inject([SomeAngular2Component],
        (component: SomeAngular2Component) =&gt; {
            console.log(iframe) // -&gt; &lt;iframe&gt;&lt;/iframe&gt; NO INNER HTML HERE
            //component.methodForIframe.(iframe);
            //expect().toBe();
}));
</code></pre>

<p>Any ideas?<br>
Thanks!!</p>