File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/react-dom/src/__tests__ Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,25 @@ describe('DOMPropertyOperations', () => {
7777 expect ( container . firstChild . getAttribute ( 'class' ) ) . toBe ( 'css-class' ) ;
7878 } ) ;
7979
80- it ( 'should not remove empty attributes for special properties' , ( ) => {
80+ it ( 'should not remove empty attributes for special input properties' , ( ) => {
8181 const container = document . createElement ( 'div' ) ;
8282 ReactDOM . render ( < input value = "" onChange = { ( ) => { } } /> , container ) ;
8383 expect ( container . firstChild . getAttribute ( 'value' ) ) . toBe ( '' ) ;
8484 expect ( container . firstChild . value ) . toBe ( '' ) ;
8585 } ) ;
8686
87+ it ( 'should not remove empty attributes for special option properties' , ( ) => {
88+ const container = document . createElement ( 'div' ) ;
89+ ReactDOM . render (
90+ < select >
91+ < option value = "" > empty</ option >
92+ </ select > ,
93+ container ,
94+ ) ;
95+ // Regression test for https://github.com/facebook/react/issues/6219
96+ expect ( container . firstChild . firstChild . value ) . toBe ( '' ) ;
97+ } ) ;
98+
8799 it ( 'should remove for falsey boolean properties' , ( ) => {
88100 const container = document . createElement ( 'div' ) ;
89101 ReactDOM . render ( < div allowFullScreen = { false } /> , container ) ;
You can’t perform that action at this time.
0 commit comments