expect(option2.selected).toBe(true)
})
+ test('create custom elements', () => {
+ const spyCreateElement = vi.spyOn(document, 'createElement')
+
+ nodeOps.createElement('custom-element')
+ expect(spyCreateElement).toHaveBeenLastCalledWith('custom-element')
+
+ nodeOps.createElement('custom-element', undefined, 'li')
+ expect(spyCreateElement).toHaveBeenLastCalledWith('custom-element', {
+ is: 'li',
+ })
+
+ spyCreateElement.mockClear()
+ })
+
describe('insertStaticContent', () => {
test('fresh insertion', () => {
const content = `<div>one</div><div>two</div>three`
? doc.createElementNS(svgNS, tag)
: namespace === 'mathml'
? doc.createElementNS(mathmlNS, tag)
- : doc.createElement(tag, is ? { is } : undefined)
+ : is
+ ? doc.createElement(tag, { is })
+ : doc.createElement(tag)
if (tag === 'select' && props && props.multiple != null) {
;(el as HTMLSelectElement).setAttribute('multiple', props.multiple)