@@ -32,6 +32,37 @@ describe("SSR spread with function source (#2815)", () => {
3232 expect ( html ) . toContain ( 'id="y"' ) ;
3333 } ) ;
3434
35+ test ( "textarea value from props merged around a spread becomes text content (#3286)" , ( ) => {
36+ const value = ( ) => "something" ;
37+ const html = renderToString ( ( ) => < textarea { ...{ "data-x" : "x" } } value = { value ( ) } /> ) ;
38+
39+ expect ( html ) . toMatch ( / d a t a - x = " x " \s * > s o m e t h i n g < \/ t e x t a r e a > / ) ;
40+ expect ( html ) . not . toContain ( ' value="something"' ) ;
41+ } ) ;
42+
43+ test ( "textarea value supplied by a spread becomes text content (#3286)" , ( ) => {
44+ const html = renderToString ( ( ) => < textarea { ...{ "data-x" : "x" , value : "something" } } /> ) ;
45+
46+ expect ( html ) . toMatch ( / d a t a - x = " x " \s * > s o m e t h i n g < \/ t e x t a r e a > / ) ;
47+ expect ( html ) . not . toContain ( ' value="something"' ) ;
48+ } ) ;
49+
50+ test ( "textarea value before a spread remains text content (#3286)" , ( ) => {
51+ const html = renderToString ( ( ) => < textarea value = "something" { ...{ "data-x" : "x" } } /> ) ;
52+
53+ expect ( html ) . toMatch ( / d a t a - x = " x " \s * > s o m e t h i n g < \/ t e x t a r e a > / ) ;
54+ expect ( html ) . not . toContain ( ' value="something"' ) ;
55+ } ) ;
56+
57+ test ( "textarea defaultValue supplied by a spread becomes text content (#3286)" , ( ) => {
58+ const html = renderToString ( ( ) => (
59+ < textarea { ...{ "data-x" : "x" , defaultValue : "something" } } />
60+ ) ) ;
61+
62+ expect ( html ) . toMatch ( / d a t a - x = " x " \s * > s o m e t h i n g < \/ t e x t a r e a > / ) ;
63+ expect ( html ) . not . toContain ( ' defaultValue="something"' ) ;
64+ } ) ;
65+
3566 test ( "Dynamic routes spreads through mergeProps" , ( ) => {
3667 const props = { "data-x" : "1" , id : "y" } ;
3768 const html = renderToString ( ( ) => < Dynamic component = "div" { ...props } /> ) ;
0 commit comments