source: imaps-frontend/node_modules/react-universal-interface/src/__tests__/render.test-server.tsx@ 0c6b92a

main
Last change on this file since 0c6b92a was d565449, checked in by stefan toskovski <stefantoska84@…>, 3 months ago

Update repo after prototype presentation

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