Commit 947d0787 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'xanf-fix-misc-failures' into 'master'

Fix misc tests which are failing in @vue/test-utils 1.x

See merge request gitlab-org/gitlab!40211
parents 924a8664 71d9844d
...@@ -61,13 +61,14 @@ describe('CommaSeparatedListTokenSelector', () => { ...@@ -61,13 +61,14 @@ describe('CommaSeparatedListTokenSelector', () => {
input.setAttribute('type', 'text'); input.setAttribute('type', 'text');
input.id = 'comma-separated-list'; input.id = 'comma-separated-list';
document.body.appendChild(div); document.body.appendChild(div);
div.appendChild(input); document.body.appendChild(input);
}); });
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
wrapper = null; wrapper = null;
div.remove(); div.remove();
input.remove();
}); });
describe('when component is mounted', () => { describe('when component is mounted', () => {
......
...@@ -41,6 +41,13 @@ const documentationPath = '/'; ...@@ -41,6 +41,13 @@ const documentationPath = '/';
const noop = () => {}; const noop = () => {};
const transitionStub = () => ({
render() {
// eslint-disable-next-line no-underscore-dangle
return this.$options._renderChildren;
},
});
const createComponent = ({ state, props, options }) => { const createComponent = ({ state, props, options }) => {
const fakeStore = new Vuex.Store({ const fakeStore = new Vuex.Store({
modules: { modules: {
...@@ -88,6 +95,7 @@ const createComponent = ({ state, props, options }) => { ...@@ -88,6 +95,7 @@ const createComponent = ({ state, props, options }) => {
}, },
...options, ...options,
store: fakeStore, store: fakeStore,
stubs: { transition: transitionStub() },
}); });
}; };
......
...@@ -645,7 +645,7 @@ describe('Dashboard', () => { ...@@ -645,7 +645,7 @@ describe('Dashboard', () => {
it('it enables draggables', () => { it('it enables draggables', () => {
expect(findRearrangeButton().attributes('pressed')).toBeTruthy(); expect(findRearrangeButton().attributes('pressed')).toBeTruthy();
expect(findEnabledDraggables()).toEqual(findDraggables()); expect(findEnabledDraggables().wrappers).toEqual(findDraggables().wrappers);
}); });
it('metrics can be swapped', () => { it('metrics can be swapped', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment