We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.6.11
https://jsfiddle.net/0jh1psog/
Open the console in the provided JSFiddle or run Vue.config.getTagNamespace('foreignObject')
Vue.config.getTagNamespace('foreignObject')
Vue.config.getTagNamespace('foreignObject') should return 'svg'
'svg'
It returns undefined.
undefined
This causes a warning Unknown custom element: <foreignObject> when testing such components using vue-test-utils
Unknown custom element: <foreignObject>
vue-test-utils
This is caused by
vue/src/platforms/web/util/element.js
Line 29 in 52719cc
foreignobject
o
makeMap
To avoid such bugs in the future, even better fix:
vue/src/shared/util.js
Line 113 in 6fe07eb
map[expectsLowerCase ? list[i].toLowerCase() : list[i]] = true
The text was updated successfully, but these errors were encountered:
Workaround (can go for example in one of your Jest setup files):
import Vue from 'vue'; const { getTagNamespace } = Vue.config; Vue.config.getTagNamespace = (tag) => { if (tag.toLowerCase() === 'foreignobject') { return 'svg'; } return getTagNamespace(tag); };
Sorry, something went wrong.
fix: give correct namespace to foreignObject
bf84687
Fix #11575
fix: give correct namespace in foreignObject (#11576)
af5e05d
Successfully merging a pull request may close this issue.
Version
2.6.11
Reproduction link
https://jsfiddle.net/0jh1psog/
Steps to reproduce
Open the console in the provided JSFiddle
or
run
Vue.config.getTagNamespace('foreignObject')
What is expected?
Vue.config.getTagNamespace('foreignObject')
should return'svg'
What is actually happening?
It returns
undefined
.This causes a warning
Unknown custom element: <foreignObject>
when testing such components usingvue-test-utils
This is caused by
vue/src/platforms/web/util/element.js
Line 29 in 52719cc
It should be
foreignobject
with lowercaseo
here, because of themakeMap
implementation.To avoid such bugs in the future, even better fix:
vue/src/shared/util.js
Line 113 in 6fe07eb
should be
map[expectsLowerCase ? list[i].toLowerCase() : list[i]] = true
The text was updated successfully, but these errors were encountered: