|
|
@@ -228,6 +228,25 @@ describe('defineCustomElement', () => {
|
|
|
await nextTick()
|
|
|
expect(el.shadowRoot!.innerHTML).toMatchInlineSnapshot('"<div>foo</div>"')
|
|
|
})
|
|
|
+
|
|
|
+ // # 5793
|
|
|
+ test('set number value in dom property', () => {
|
|
|
+ const E = defineCustomElement({
|
|
|
+ props: {
|
|
|
+ 'max-age': Number
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ // @ts-ignore
|
|
|
+ return `max age: ${this.maxAge}/type: ${typeof this.maxAge}`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ customElements.define('my-element-number-property', E)
|
|
|
+ const el = document.createElement('my-element-number-property') as any
|
|
|
+ container.appendChild(el)
|
|
|
+ el.maxAge = 50
|
|
|
+ expect(el.maxAge).toBe(50)
|
|
|
+ expect(el.shadowRoot.innerHTML).toBe('max age: 50/type: number')
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
describe('attrs', () => {
|