From ce9f541283e80fb388d6048eb44172c13222cba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Schn=C3=BCriger?= Date: Fri, 6 Mar 2020 13:15:36 +0100 Subject: [PATCH 1/4] Alternative approach to preserve mountOptions I suggest an alternative approach to the problem to preserve things like `props, propsData, updateProps` that are applied to the root node only. --- src/__tests__/vuetify.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/__tests__/vuetify.js b/src/__tests__/vuetify.js index 9cc8962e..4f647890 100644 --- a/src/__tests__/vuetify.js +++ b/src/__tests__/vuetify.js @@ -15,18 +15,13 @@ Vue.use(Vuetify) // a
node. const renderWithVuetify = (component, options, callback) => { return render( - // anonymous component + component, + // for Vuetify components that use the $vuetify instance property { - // Vue's render function - render(createElement) { - // wrap the component with a
node and render the test component - return createElement('div', {attrs: {'data-app': true}}, [ - createElement(component), - ]) - }, + container: document.createElement('div').setAttribute('data-app', 'true'), + vuetify: new Vuetify(), + ...options }, - // for Vuetify components that use the $vuetify instance property - {vuetify: new Vuetify(), ...options}, callback, ) } From 5ec3b996c9404ff4ea383ec0e54513b6b0f00672 Mon Sep 17 00:00:00 2001 From: "edgar.schnueriger" Date: Fri, 6 Mar 2020 13:26:49 +0100 Subject: [PATCH 2/4] Add tests --- src/__tests__/components/Vuetify.vue | 7 +++++++ src/__tests__/vuetify.js | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/__tests__/components/Vuetify.vue b/src/__tests__/components/Vuetify.vue index 3add64fa..b6ec8489 100644 --- a/src/__tests__/components/Vuetify.vue +++ b/src/__tests__/components/Vuetify.vue @@ -7,12 +7,19 @@ Lorem ipsum dolor sit amet. + This is a hint