Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Should automatically add px suffix to whitelisted numeric style properties', () => {
render(<div style="{{">foo</div>, container);
expect(innerHTML(container.innerHTML)).toBe(innerHTML(`<div style="width: 10px; z-index: 1;">foo</div>`));
});
it('should export instance', () => {
class App extends Component {
render() {
return null;
}
componentDidMount() {
this.renderInner();
}
renderInner() {
const wrapper = document.createElement('div');
this.inner = unstable_renderSubtreeIntoContainer(this, , wrapper);
}
}
const root = document.createElement('div');
const app = render(, root);
expect(typeof app.inner.getNode === 'function').toEqual(true);
});
it('should have isPropagationStopped and isDefaultPrevented defined in Event prototype', () => {
const spyObj = {
foo: event => {
expect(event.isDefaultPrevented()).toBe(false);
expect(event.isPropagationStopped()).toBe(false);
event.preventDefault();
expect(event.isDefaultPrevented()).toBe(true);
event.stopPropagation();
expect(event.isPropagationStopped()).toBe(true);
}
};
spyOn(spyObj, 'foo').and.callThrough();
render(<div>, container);
container.firstChild.click();
expect(spyObj.foo).toHaveBeenCalledTimes(1);
});
});</div>
function renderIntoDocument(input) {
return React.render(createComponentVNode(VNodeFlags.ComponentClass, Wrapper, { children: input }), container);
}
afterEach(function() {
render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
function renderIntoDocument(input) {
return React.render(createComponentVNode(VNodeFlags.ComponentClass, Wrapper, { children: input }), container);
}
afterEach(function() {
render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
afterEach(function() {
render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
afterEach(() => {
React.render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
function(state) {
render(main(state), container);
},
function(samples) {