File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,19 @@ test('custom event listeners and properties are ignored', function (t) {
3737 el . click ( )
3838} )
3939
40- test ( 'input values get copied' , function ( t ) {
40+ test ( 'input value gets copied from mutating element ' , function ( t ) {
4141 t . plan ( 1 )
4242 var el = yo `<input type="text" />`
43- el . value = 'hi'
43+ var newEl = yo `<input type="text" />`
44+ newEl . setAttribute ( 'value' , 'hi' )
45+ yo . update ( el , newEl )
46+ t . equal ( el . value , 'hi' )
47+ } )
48+
49+ test ( 'input value is kept if mutating element doesn\'t have one' , function ( t ) {
50+ t . plan ( 1 )
51+ var el = yo `<input type="text" />`
52+ el . setAttribute ( 'value' , 'hi' )
4453 var newEl = yo `<input type="text" />`
4554 yo . update ( el , newEl )
4655 t . equal ( el . value , 'hi' )
You can’t perform that action at this time.
0 commit comments