import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import MarkupFrame from '../src';

describe( '<MarkupFrame />', () => {
	it( 'renders an iframe', () => {
		const wrapper = mount( <MarkupFrame markup="" /> );
		expect( wrapper.some( 'iframe' ) ).to.equal( true );
	} );

	it( 'injects props.markup into the iframe' );

	it( 'calls props.onLoad with the iframe document' );
} );

@@ -147,21 +147,26 @@
 me /%3E', 
-() =%3E
+function()
  %7B%0A%09it( 
@@ -190,13 +190,18 @@
 e', 
-() =%3E
+function()
  %7B%0A%09
@@ -275,12 +275,12 @@
 per.
-some
+find
 ( 'i
@@ -297,19 +297,22 @@
 .to.
-equal( true
+have.length( 1
  );%0A
@@ -365,63 +365,514 @@
 ame'
- );%0A%0A%09it( 'calls props.onLoad with the iframe document'
+, function() %7B%0A%09%09const wrapper = mount( %3CMarkupFrame markup=%22%3Ch1%3EHello World%3C/h1%3E%22 /%3E );%0A%09%09expect( wrapper.find( 'iframe' ).get( 0 ).innerHTML ).to.eql( '%3Ch1%3EHello World%3C/h1%3E' )%0A%09%7D );%0A%0A%09it( 'calls props.onLoad with the iframe document', function() %7B%0A%09%09const onLoad = doc =%3E doc.querySelector( 'h1' ).innerHTML = 'greetings';%0A%09%09const wrapper = mount( %3CMarkupFrame markup=%22%3Ch1%3EHello World%3C/h1%3E%22 onLoad=%7B onLoad %7D /%3E );%0A%09%09expect( wrapper.find( 'iframe' ).get( 0 ).innerHTML ).to.eql( '%3Ch1%3Egreetings%3C/h1%3E' )%0A%09%7D
  );%0A

Update tests to cover most common cases