@@ -258,8 +258,8 @@ describe('ReactDOMInput', () => {
258
258
}
259
259
}
260
260
261
- var stub = ReactTestUtils . renderIntoDocument ( < Stub /> ) ;
262
- var node = ReactDOM . findDOMNode ( stub ) ;
261
+ const stub = ReactTestUtils . renderIntoDocument ( < Stub /> ) ;
262
+ const node = ReactDOM . findDOMNode ( stub ) ;
263
263
stub . setState ( { value : 0 } ) ;
264
264
265
265
expect ( node . value ) . toEqual ( '0' ) ;
@@ -628,36 +628,36 @@ describe('ReactDOMInput', () => {
628
628
} ) ;
629
629
630
630
it ( 'should properly transition a text input from 0 to an empty 0.0' , function ( ) {
631
- var container = document . createElement ( 'div' ) ;
631
+ const container = document . createElement ( 'div' ) ;
632
632
633
633
ReactDOM . render ( < input type = "text" value = { 0 } /> , container ) ;
634
634
ReactDOM . render ( < input type = "text" value = "0.0" /> , container ) ;
635
635
636
- var node = container . firstChild ;
636
+ const node = container . firstChild ;
637
637
638
638
expect ( node . value ) . toBe ( '0.0' ) ;
639
639
expect ( node . defaultValue ) . toBe ( '0.0' ) ;
640
640
} ) ;
641
641
642
642
it ( 'should properly transition a number input from "" to 0' , function ( ) {
643
- var container = document . createElement ( 'div' ) ;
643
+ const container = document . createElement ( 'div' ) ;
644
644
645
645
ReactDOM . render ( < input type = "number" value = "" /> , container ) ;
646
646
ReactDOM . render ( < input type = "number" value = { 0 } /> , container ) ;
647
647
648
- var node = container . firstChild ;
648
+ const node = container . firstChild ;
649
649
650
650
expect ( node . value ) . toBe ( '0' ) ;
651
651
expect ( node . defaultValue ) . toBe ( '0' ) ;
652
652
} ) ;
653
653
654
654
it ( 'should properly transition a number input from "" to "0"' , function ( ) {
655
- var container = document . createElement ( 'div' ) ;
655
+ const container = document . createElement ( 'div' ) ;
656
656
657
657
ReactDOM . render ( < input type = "number" value = "" /> , container ) ;
658
658
ReactDOM . render ( < input type = "number" value = "0" /> , container ) ;
659
659
660
- var node = container . firstChild ;
660
+ const node = container . firstChild ;
661
661
662
662
expect ( node . value ) . toBe ( '0' ) ;
663
663
expect ( node . defaultValue ) . toBe ( '0' ) ;
@@ -1644,12 +1644,12 @@ describe('ReactDOMInput', () => {
1644
1644
describe ( 'When given a Symbol value' , function ( ) {
1645
1645
it ( 'treats initial Symbol value as an empty string' , function ( ) {
1646
1646
spyOnDev ( console , 'error' ) ;
1647
- var container = document . createElement ( 'div' ) ;
1647
+ const container = document . createElement ( 'div' ) ;
1648
1648
ReactDOM . render (
1649
1649
< input value = { Symbol ( 'foobar' ) } onChange = { ( ) => { } } /> ,
1650
1650
container ,
1651
1651
) ;
1652
- var node = container . firstChild ;
1652
+ const node = container . firstChild ;
1653
1653
1654
1654
expect ( node . value ) . toBe ( '' ) ;
1655
1655
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
@@ -1664,13 +1664,13 @@ describe('ReactDOMInput', () => {
1664
1664
1665
1665
it ( 'treats updated Symbol value as an empty string' , function ( ) {
1666
1666
spyOnDev ( console , 'error' ) ;
1667
- var container = document . createElement ( 'div' ) ;
1667
+ const container = document . createElement ( 'div' ) ;
1668
1668
ReactDOM . render ( < input value = "foo" onChange = { ( ) => { } } /> , container ) ;
1669
1669
ReactDOM . render (
1670
1670
< input value = { Symbol ( 'foobar' ) } onChange = { ( ) => { } } /> ,
1671
1671
container ,
1672
1672
) ;
1673
- var node = container . firstChild ;
1673
+ const node = container . firstChild ;
1674
1674
1675
1675
expect ( node . value ) . toBe ( '' ) ;
1676
1676
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
@@ -1684,20 +1684,20 @@ describe('ReactDOMInput', () => {
1684
1684
} ) ;
1685
1685
1686
1686
it ( 'treats initial Symbol defaultValue as an empty string' , function ( ) {
1687
- var container = document . createElement ( 'div' ) ;
1687
+ const container = document . createElement ( 'div' ) ;
1688
1688
ReactDOM . render ( < input defaultValue = { Symbol ( 'foobar' ) } /> , container ) ;
1689
- var node = container . firstChild ;
1689
+ const node = container . firstChild ;
1690
1690
1691
1691
expect ( node . value ) . toBe ( '' ) ;
1692
1692
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
1693
1693
// TODO: we should warn here.
1694
1694
} ) ;
1695
1695
1696
1696
it ( 'treats updated Symbol defaultValue as an empty string' , function ( ) {
1697
- var container = document . createElement ( 'div' ) ;
1697
+ const container = document . createElement ( 'div' ) ;
1698
1698
ReactDOM . render ( < input defaultValue = "foo" /> , container ) ;
1699
1699
ReactDOM . render ( < input defaultValue = { Symbol ( 'foobar' ) } /> , container ) ;
1700
- var node = container . firstChild ;
1700
+ const node = container . firstChild ;
1701
1701
1702
1702
expect ( node . value ) . toBe ( 'foo' ) ;
1703
1703
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
@@ -1708,12 +1708,12 @@ describe('ReactDOMInput', () => {
1708
1708
describe ( 'When given a function value' , function ( ) {
1709
1709
it ( 'treats initial function value as an empty string' , function ( ) {
1710
1710
spyOnDev ( console , 'error' ) ;
1711
- var container = document . createElement ( 'div' ) ;
1711
+ const container = document . createElement ( 'div' ) ;
1712
1712
ReactDOM . render (
1713
1713
< input value = { ( ) => { } } onChange = { ( ) => { } } /> ,
1714
1714
container ,
1715
1715
) ;
1716
- var node = container . firstChild ;
1716
+ const node = container . firstChild ;
1717
1717
1718
1718
expect ( node . value ) . toBe ( '' ) ;
1719
1719
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
@@ -1728,13 +1728,13 @@ describe('ReactDOMInput', () => {
1728
1728
1729
1729
it ( 'treats updated function value as an empty string' , function ( ) {
1730
1730
spyOnDev ( console , 'error' ) ;
1731
- var container = document . createElement ( 'div' ) ;
1731
+ const container = document . createElement ( 'div' ) ;
1732
1732
ReactDOM . render ( < input value = "foo" onChange = { ( ) => { } } /> , container ) ;
1733
1733
ReactDOM . render (
1734
1734
< input value = { ( ) => { } } onChange = { ( ) => { } } /> ,
1735
1735
container ,
1736
1736
) ;
1737
- var node = container . firstChild ;
1737
+ const node = container . firstChild ;
1738
1738
1739
1739
expect ( node . value ) . toBe ( '' ) ;
1740
1740
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
@@ -1748,20 +1748,20 @@ describe('ReactDOMInput', () => {
1748
1748
} ) ;
1749
1749
1750
1750
it ( 'treats initial function defaultValue as an empty string' , function ( ) {
1751
- var container = document . createElement ( 'div' ) ;
1751
+ const container = document . createElement ( 'div' ) ;
1752
1752
ReactDOM . render ( < input defaultValue = { ( ) => { } } /> , container ) ;
1753
- var node = container . firstChild ;
1753
+ const node = container . firstChild ;
1754
1754
1755
1755
expect ( node . value ) . toBe ( '' ) ;
1756
1756
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
1757
1757
// TODO: we should warn here.
1758
1758
} ) ;
1759
1759
1760
1760
it ( 'treats updated function defaultValue as an empty string' , function ( ) {
1761
- var container = document . createElement ( 'div' ) ;
1761
+ const container = document . createElement ( 'div' ) ;
1762
1762
ReactDOM . render ( < input defaultValue = "foo" /> , container ) ;
1763
1763
ReactDOM . render ( < input defaultValue = { ( ) => { } } /> , container ) ;
1764
- var node = container . firstChild ;
1764
+ const node = container . firstChild ;
1765
1765
1766
1766
expect ( node . value ) . toBe ( 'foo' ) ;
1767
1767
expect ( node . getAttribute ( 'value' ) ) . toBe ( '' ) ;
0 commit comments