source: imaps-frontend/node_modules/react-universal-interface/src/__tests__/createEnhancer.test-server.tsx@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 737 bytes
Line 
1import * as React from 'react';
2import {renderToString} from 'react-dom/server';
3import {expect} from 'chai';
4import render from '../render';
5import createEnhancer from '../createEnhancer';
6
7const Parent = (props) => render(props, {foo: 'bar'});
8const withParent = createEnhancer(Parent, 'parent');
9
10describe('createEnhancer() SSR', () => {
11 it('exists and does not crash', () => {
12 expect(typeof createEnhancer).to.equal('function');
13 });
14
15 it('renders as expected', () => {
16 const Comp = (props) => <div>{props.parent.foo}</div>;
17 const CompEnhanced = withParent(Comp);
18 const html = renderToString(<CompEnhanced />);
19
20 expect(html).to.equal('<div data-reactroot="">bar</div>');
21 });
22});
Note: See TracBrowser for help on using the repository browser.