File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1- import { describe , expect , it } from 'vitest'
1+ import { describe , expect , it , vi } from 'vitest'
22import { defineAsyncComponent , defineComponent } from 'vue'
33import { mount , shallowMount , VueWrapper } from '../src'
44import ComponentWithChildren from './components/ComponentWithChildren.vue'
@@ -226,4 +226,32 @@ describe('shallowMount', () => {
226226
227227 expect ( wrapper . find ( 'computed-property-stub' ) . exists ( ) ) . toBe ( false )
228228 } )
229+
230+ it ( 'should set prop that is shared with Element' , async ( ) => {
231+ const spyWarn = vi . spyOn ( console , 'warn' )
232+
233+ const TestComp = defineComponent ( {
234+ props : {
235+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/prefix
236+ prefix : String
237+ } ,
238+ template : '<div />'
239+ } )
240+
241+ const wrapper = mount (
242+ defineComponent ( {
243+ components : { TestComp } ,
244+ template : '<TestComp prefix="foo" />'
245+ } ) ,
246+ { shallow : true }
247+ )
248+ expect ( wrapper . html ( ) ) . toBe (
249+ '<test-comp-stub prefix="foo"></test-comp-stub>'
250+ )
251+
252+ expect ( wrapper . findComponent ( TestComp ) . props ( 'prefix' ) ) . toBe ( 'foo' )
253+
254+ expect ( spyWarn ) . not . toHaveBeenCalled ( )
255+ spyWarn . mockRestore ( )
256+ } )
229257} )
You can’t perform that action at this time.
0 commit comments