From 386cf29f3de369c95e12d9f2a7961c3cb22bd3d9 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Tue, 23 Feb 2021 16:27:41 -0700 Subject: [PATCH 1/2] Update Vuex docs to remove reference to createLocalVue --- doc/development/fe_guide/vuex.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/development/fe_guide/vuex.md b/doc/development/fe_guide/vuex.md index cc1d9ccab77feb..0923b9dce173ab 100644 --- a/doc/development/fe_guide/vuex.md +++ b/doc/development/fe_guide/vuex.md @@ -440,12 +440,11 @@ components, we need to include the store and provide the correct state: //component_spec.js import Vue from 'vue'; import Vuex from 'vuex'; -import { mount, createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import { createStore } from './store'; import Component from './component.vue' -const localVue = createLocalVue(); -localVue.use(Vuex); +Vue.use(Vuex); describe('component', () => { let store; @@ -455,7 +454,6 @@ describe('component', () => { store = createStore(); wrapper = mount(Component, { - localVue, store, }); }; @@ -483,6 +481,12 @@ describe('component', () => { }); ``` +>>> +Note that some test files may still use the [deprecated `createLocalVue` function](https://gitlab.com/gitlab-org/gitlab/-/issues/220482) from `@vue/test-utils` and `localVue.use(Vuex)`. + +This is unnecessary, and should be avoided or removed when possible. +>>> + ### Two way data binding When storing form data in Vuex, it is sometimes necessary to update the value stored. The store -- GitLab From 93f10112c51581d4823ccb0e79280d3ba9ad45a5 Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Wed, 24 Feb 2021 19:34:24 +0000 Subject: [PATCH 2/2] Rewrite to more standard format --- doc/development/fe_guide/vuex.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/development/fe_guide/vuex.md b/doc/development/fe_guide/vuex.md index 0923b9dce173ab..d44ab64ae5d52e 100644 --- a/doc/development/fe_guide/vuex.md +++ b/doc/development/fe_guide/vuex.md @@ -481,11 +481,10 @@ describe('component', () => { }); ``` ->>> -Note that some test files may still use the [deprecated `createLocalVue` function](https://gitlab.com/gitlab-org/gitlab/-/issues/220482) from `@vue/test-utils` and `localVue.use(Vuex)`. - -This is unnecessary, and should be avoided or removed when possible. ->>> +Some test files may still use the +[deprecated `createLocalVue` function](https://gitlab.com/gitlab-org/gitlab/-/issues/220482) +from `@vue/test-utils` and `localVue.use(Vuex)`. This is unnecessary, and should be +avoided or removed when possible. ### Two way data binding -- GitLab