diff --git a/packages/vuetify/package.json b/packages/vuetify/package.json index 0fc196dd1a6..2dd9fce894a 100755 --- a/packages/vuetify/package.json +++ b/packages/vuetify/package.json @@ -71,7 +71,7 @@ "@types/jest": "^26.0.14", "@types/node": "^14.11.10", "@vue/babel-plugin-jsx": "^1.0.2", - "@vue/test-utils": "^2.0.0-beta.7", + "@vue/test-utils": "^2.0.0-rc.2", "autoprefixer": "^9.6.1", "babel-loader": "^8.0.6", "babel-plugin-add-import-extension": "^1.4.3", diff --git a/packages/vuetify/src/components/VImg/VImg.tsx b/packages/vuetify/src/components/VImg/VImg.tsx index c547129d458..31c76b06e21 100644 --- a/packages/vuetify/src/components/VImg/VImg.tsx +++ b/packages/vuetify/src/components/VImg/VImg.tsx @@ -4,9 +4,11 @@ import './VImg.sass' import { computed, defineComponent, + getCurrentInstance, h, nextTick, onBeforeMount, + reactive, ref, vShow, watch, @@ -74,14 +76,16 @@ export default defineComponent({ emits: ['loadstart', 'load', 'error'], - setup (props, { emit, expose, slots }) { + setup (props, { emit, slots }) { const currentSrc = ref('') // Set from srcset const image = ref() const state = ref<'idle' | 'loading' | 'loaded' | 'error'>('idle') const naturalWidth = ref() const naturalHeight = ref() - expose({ + // TODO: use expose() https://github.com/vuejs/vue-test-utils-next/issues/435 + const vm = getCurrentInstance() as any + vm.setupState = reactive({ currentSrc, image, state, diff --git a/yarn.lock b/yarn.lock index 5525bf5da1d..4742594ab1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4799,10 +4799,10 @@ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.7.tgz#96d52988efc07444c108c7c6803ba7cc93e40045" integrity sha512-dn5FyfSc4ky424jH4FntiHno7Ss5yLkqKNmM/NXwANRnlkmqu74pnGetexDFVG5phMk9/FhwovUZCWGxsotVKg== -"@vue/test-utils@^2.0.0-beta.7": - version "2.0.0-beta.7" - resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-2.0.0-beta.7.tgz#27751991e0b013ee4af487e51e16a58d477e5857" - integrity sha512-cAe7VqoxxkxTr/2N93UpW/LQbcUVKC+QRA3ZBq5ZWImtAf/8jtcdC2mQ9g4AKmSvyaKQtqxrRn4i/y5z7yrrKA== +"@vue/test-utils@^2.0.0-rc.2": + version "2.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-2.0.0-rc.2.tgz#a43cb6d1a30d16bb50fa3561397ba1e252683f9d" + integrity sha512-doOtnkleRTiN5rk+Losawe9/8i//8rncZ3lIhz/1vnONHDnthF1XjlI7pGZ1RV5uZJ3IUt3yVjwY7W6q9WhlRw== "@vue/web-component-wrapper@^1.2.0": version "1.2.0"