Skip to content

Commit 1d93c20

Browse files
committed
Fix test
1 parent 4fb2d81 commit 1d93c20

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)