react-frame-component
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -9,6 +9,3 @@ var React = require('react'); | ||
render: function() { | ||
return React.createElement('iframe', { | ||
style: this.props.style, | ||
head: this.props.head | ||
}); | ||
return React.createElement('iframe', this.props); | ||
}, | ||
@@ -15,0 +12,0 @@ componentDidMount: function() { |
{ | ||
"name": "react-frame-component", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,2 +33,20 @@ /** @jsx React.DOM */ | ||
it("should pass along all props to underlying iFrame", function () { | ||
var frame = ReactTestUtils.renderIntoDocument( | ||
<Frame className="test-class-1 test-class-2" | ||
frameBorder={0} | ||
height="100%" | ||
width="80%" /> | ||
); | ||
var node = frame.getDOMNode(); | ||
expect(frame.props.className).toEqual('test-class-1 test-class-2'); | ||
expect(frame.props.frameBorder).toEqual(0); | ||
expect(frame.props.height).toEqual('100%'); | ||
expect(frame.props.width).toEqual('80%'); | ||
expect(node.className).toEqual('test-class-1 test-class-2'); | ||
expect(node.getAttribute('frameBorder')).toEqual('0'); | ||
expect(node.getAttribute('height')).toEqual('100%'); | ||
expect(node.getAttribute('width')).toEqual('80%'); | ||
}); | ||
it("should create an iFrame with a <link> tag inside", function () { | ||
@@ -35,0 +53,0 @@ div = document.body.appendChild(document.createElement('div')); |
644942
17868