Run karma unit tests for custom components which contains v-dialog or v-menu.
vuetify 0.14.7
vue 2.4.2
All test should pass without any error or warning
When testing components which contains v-dialog or v-menu (both using detachable mixin), the warning Application is missing <v-app> component.
keeps displaying
I created simple repo with three tests (using vue init vuetify/webpack + karma unit tests)
https://github.com/lattam/vuetify-test-example
Note: In Menu.spec.js I tried to wrap the component into <v-app>
element, but the warning keeps displaying.
Thanks for any help!
Add the following code to your test/unit/index.js
file
var app = document.createElement('div')
app.setAttribute('data-app', true)
document.body.appendChild(app)
That way there will always be a div with data-app attribute in your tests for components to use
Most helpful comment
Add the following code to your
test/unit/index.js
fileThat way there will always be a div with data-app attribute in your tests for components to use