File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1512,6 +1512,16 @@ describe('SSR hydration', () => {
1512
1512
expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
1513
1513
} )
1514
1514
1515
+ test ( 'client value is null or undefined' , ( ) => {
1516
+ mountWithHydration ( `<div></div>` , ( ) =>
1517
+ h ( 'div' , { draggable : undefined } ) ,
1518
+ )
1519
+ expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
1520
+
1521
+ mountWithHydration ( `<input />` , ( ) => h ( 'input' , { type : null } ) )
1522
+ expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
1523
+ } )
1524
+
1515
1525
test ( 'should not warn against object values' , ( ) => {
1516
1526
mountWithHydration ( `<input />` , ( ) => h ( 'input' , { from : { } } ) )
1517
1527
expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
Original file line number Diff line number Diff line change @@ -758,6 +758,9 @@ function propHasMismatch(
758
758
if ( isBooleanAttr ( key ) ) {
759
759
actual = el . hasAttribute ( key )
760
760
expected = includeBooleanAttr ( clientValue )
761
+ } else if ( clientValue == null ) {
762
+ actual = el . hasAttribute ( key )
763
+ expected = false
761
764
} else {
762
765
if ( el . hasAttribute ( key ) ) {
763
766
actual = el . getAttribute ( key )
You can’t perform that action at this time.
0 commit comments