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 | |
---|
1 | import * as React from 'react';
|
---|
2 | import {renderToString} from 'react-dom/server';
|
---|
3 | import {expect} from 'chai';
|
---|
4 | import render from '../render';
|
---|
5 |
|
---|
6 | const Parent = (props) => render(props, {foo: 'bar'});
|
---|
7 |
|
---|
8 | describe('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.