@@ -21,7 +21,9 @@ public void RenderHtmlShouldThrowExceptionIfComponentDoesNotExist()
21
21
{
22
22
var environment = new Mock < IReactEnvironment > ( ) ;
23
23
environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( false ) ;
24
- var component = new ReactComponent ( environment . Object , null , "Foo" , "container" ) ;
24
+ var config = new Mock < IReactSiteConfiguration > ( ) ;
25
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
26
+ var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" ) ;
25
27
26
28
Assert . Throws < ReactInvalidComponentException > ( ( ) =>
27
29
{
@@ -35,6 +37,7 @@ public void RenderHtmlShouldCallRenderComponent()
35
37
var environment = new Mock < IReactEnvironment > ( ) ;
36
38
environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
37
39
var config = new Mock < IReactSiteConfiguration > ( ) ;
40
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
38
41
39
42
var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
40
43
{
@@ -53,6 +56,7 @@ public void RenderHtmlShouldWrapComponentInDiv()
53
56
environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
54
57
. Returns ( "[HTML]" ) ;
55
58
var config = new Mock < IReactSiteConfiguration > ( ) ;
59
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
56
60
57
61
var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
58
62
{
@@ -88,6 +92,7 @@ public void RenderHtmlShouldNotRenderClientSideAttributes()
88
92
var environment = new Mock < IReactEnvironment > ( ) ;
89
93
environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
90
94
var config = new Mock < IReactSiteConfiguration > ( ) ;
95
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
91
96
92
97
var component = new ReactComponent ( environment . Object , config . Object , "Foo" , "container" )
93
98
{
@@ -102,6 +107,7 @@ public void RenderHtmlShouldNotRenderClientSideAttributes()
102
107
public void RenderHtmlShouldWrapComponentInCustomElement ( )
103
108
{
104
109
var config = new Mock < IReactSiteConfiguration > ( ) ;
110
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
105
111
var environment = new Mock < IReactEnvironment > ( ) ;
106
112
environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
107
113
environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
@@ -121,6 +127,7 @@ public void RenderHtmlShouldWrapComponentInCustomElement()
121
127
public void RenderHtmlShouldAddClassToElement ( )
122
128
{
123
129
var config = new Mock < IReactSiteConfiguration > ( ) ;
130
+ config . Setup ( x => x . UseServerSideRendering ) . Returns ( true ) ;
124
131
var environment = new Mock < IReactEnvironment > ( ) ;
125
132
environment . Setup ( x => x . Execute < bool > ( "typeof Foo !== 'undefined'" ) ) . Returns ( true ) ;
126
133
environment . Setup ( x => x . Execute < string > ( @"ReactDOMServer.renderToString(React.createElement(Foo, {""hello"":""World""}))" ) )
0 commit comments