Ensure FullPageComponents are treated as DOM components
We currently override a couple DOM components. We need to ensure everything we override is still treated as a DOM component, even if it has a composite component wrapper.
This commit is contained in:
parent
93e67a0a5b
commit
99cbaed836
|
@ -33,6 +33,7 @@ function createFullPageComponent(tag) {
|
|||
var elementFactory = ReactElement.createFactory(tag);
|
||||
|
||||
var FullPageComponent = ReactClass.createClass({
|
||||
tagName: tag.toUpperCase(),
|
||||
displayName: 'ReactFullPageComponent' + tag,
|
||||
|
||||
componentWillUnmount: function() {
|
||||
|
|
|
@ -206,4 +206,28 @@ describe('ReactTestUtils', function() {
|
|||
|
||||
expect(console.warn.calls.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should support injected wrapper components as DOM components', function() {
|
||||
var injectedDOMComponents = [
|
||||
'button',
|
||||
'form',
|
||||
'iframe',
|
||||
'img',
|
||||
'input',
|
||||
'option',
|
||||
'select',
|
||||
'textarea',
|
||||
'html',
|
||||
'head',
|
||||
'body'
|
||||
];
|
||||
|
||||
injectedDOMComponents.forEach(function(type) {
|
||||
var component = ReactTestUtils.renderIntoDocument(
|
||||
React.createElement(type)
|
||||
);
|
||||
expect(component.tagName).toBe(type.toUpperCase());
|
||||
expect(ReactTestUtils.isDOMComponent(component)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue