test: add test

This commit is contained in:
tycho 2024-10-18 17:43:19 +08:00
parent 92b1d9b2cc
commit e9c954f141
1 changed files with 8 additions and 0 deletions

View File

@ -394,4 +394,12 @@ describe('runtime-dom: props patching', () => {
expect(fn).toBeCalledTimes(0)
})
// #12211
test('should not override content when `text` attribute is set', () => {
const root = document.createElement('div')
render(h('a', { text: '' }, ['foo']), root)
const a = root.children[0]
expect(a.textContent).toBe('foo')
})
})