Commit 3071b71a authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'renovate-vue/vue-router-3.x' into 'master'

[RUN-AS-IF-FOSS] Update dependency vue-router to ^3.4.3

See merge request gitlab-org/gitlab!39200
parents dbd0fc44 cfc0cbb0
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
// if this upload resulted in a new version being created, redirect user to the latest version // if this upload resulted in a new version being created, redirect user to the latest version
if (!this.isLatestVersion) { if (!this.isLatestVersion) {
this.$router.push({ name: DESIGNS_ROUTE_NAME }); this.$router.push({ name: DESIGNS_ROUTE_NAME }, () => {});
} }
this.resetFilesToBeSaved(); this.resetFilesToBeSaved();
}, },
......
...@@ -138,7 +138,7 @@ describe('First class vulnerability filters component', () => { ...@@ -138,7 +138,7 @@ describe('First class vulnerability filters component', () => {
listeners: { filterChange: filterChangeSpy }, listeners: { filterChange: filterChangeSpy },
}); });
router.push({ query: { [filter]: value.split(',') } }); router.push({ query: { [filter]: value.split(',') } }, () => {});
}); });
it(`should have the ${filter} filter as pre-selected`, () => { it(`should have the ${filter} filter as pre-selected`, () => {
......
...@@ -478,16 +478,15 @@ describe('Design management index page', () => { ...@@ -478,16 +478,15 @@ describe('Design management index page', () => {
describe('on non-latest version', () => { describe('on non-latest version', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ designs: mockDesigns, allVersions: [mockVersion] }); createComponent({ designs: mockDesigns, allVersions: [mockVersion] });
});
router.replace({ it('does not render design checkboxes', async () => {
await router.replace({
name: DESIGNS_ROUTE_NAME, name: DESIGNS_ROUTE_NAME,
query: { query: {
version: '2', version: '2',
}, },
}); });
});
it('does not render design checkboxes', () => {
expect(findDesignCheckboxes()).toHaveLength(0); expect(findDesignCheckboxes()).toHaveLength(0);
}); });
...@@ -514,13 +513,6 @@ describe('Design management index page', () => { ...@@ -514,13 +513,6 @@ describe('Design management index page', () => {
files: [{ name: 'image.png', type: 'image/png' }], files: [{ name: 'image.png', type: 'image/png' }],
getData: () => 'test.png', getData: () => 'test.png',
}; };
router.replace({
name: DESIGNS_ROUTE_NAME,
query: {
version: '2',
},
});
}); });
it('does not call paste event if designs wrapper is not hovered', () => { it('does not call paste event if designs wrapper is not hovered', () => {
......
...@@ -450,16 +450,15 @@ describe('Design management index page', () => { ...@@ -450,16 +450,15 @@ describe('Design management index page', () => {
describe('on non-latest version', () => { describe('on non-latest version', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ designs: mockDesigns, allVersions: [mockVersion] }); createComponent({ designs: mockDesigns, allVersions: [mockVersion] });
});
router.replace({ it('does not render design checkboxes', async () => {
await router.replace({
name: DESIGNS_ROUTE_NAME, name: DESIGNS_ROUTE_NAME,
query: { query: {
version: '2', version: '2',
}, },
}); });
});
it('does not render design checkboxes', () => {
expect(findDesignCheckboxes()).toHaveLength(0); expect(findDesignCheckboxes()).toHaveLength(0);
}); });
...@@ -482,16 +481,9 @@ describe('Design management index page', () => { ...@@ -482,16 +481,9 @@ describe('Design management index page', () => {
}); });
event = new Event('paste'); event = new Event('paste');
router.replace({
name: DESIGNS_ROUTE_NAME,
query: {
version: '2',
},
});
}); });
it('calls onUploadDesign with valid paste', () => { it('calls onUploadDesign with valid paste', async () => {
event.clipboardData = { event.clipboardData = {
files: [{ name: 'image.png', type: 'image/png' }], files: [{ name: 'image.png', type: 'image/png' }],
getData: () => 'test.png', getData: () => 'test.png',
...@@ -532,11 +524,12 @@ describe('Design management index page', () => { ...@@ -532,11 +524,12 @@ describe('Design management index page', () => {
}); });
describe('when navigating', () => { describe('when navigating', () => {
it('ensures fullscreen layout is not applied', () => { it('ensures fullscreen layout is not applied', async () => {
createComponent(true); createComponent(true);
wrapper.vm.$router.push('/designs'); await wrapper.vm.$router.replace('/');
expect(mockPageEl.classList.remove).toHaveBeenCalledTimes(1); await wrapper.vm.$router.replace('/designs');
expect(mockPageEl.classList.remove).toHaveBeenCalledTimes(2);
expect(mockPageEl.classList.remove).toHaveBeenCalledWith(...DESIGN_DETAIL_LAYOUT_CLASSLIST); expect(mockPageEl.classList.remove).toHaveBeenCalledWith(...DESIGN_DETAIL_LAYOUT_CLASSLIST);
}); });
}); });
......
...@@ -17,9 +17,13 @@ describe('~/ide/sync_router_and_store', () => { ...@@ -17,9 +17,13 @@ describe('~/ide/sync_router_and_store', () => {
const getRouterCurrentPath = () => router.currentRoute.fullPath; const getRouterCurrentPath = () => router.currentRoute.fullPath;
const getStoreCurrentPath = () => store.state.router.fullPath; const getStoreCurrentPath = () => store.state.router.fullPath;
const updateRouter = path => { const updateRouter = async path => {
if (getRouterCurrentPath() === path) {
return;
}
router.push(path); router.push(path);
return waitForPromises(); await waitForPromises();
}; };
const updateStore = path => { const updateStore = path => {
store.dispatch('router/push', path); store.dispatch('router/push', path);
......
...@@ -12295,10 +12295,10 @@ vue-loader@^15.9.0: ...@@ -12295,10 +12295,10 @@ vue-loader@^15.9.0:
vue-hot-reload-api "^2.3.0" vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0" vue-style-loader "^4.1.0"
vue-router@^3.0.2: vue-router@^3.4.3:
version "3.0.2" version "3.4.3"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.2.tgz#dedc67afe6c4e2bc25682c8b1c2a8c0d7c7e56be" resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.4.3.tgz#fa93768616ee338aa174f160ac965167fa572ffa"
integrity sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg== integrity sha512-BADg1mjGWX18Dpmy6bOGzGNnk7B/ZA0RxuA6qedY/YJwirMfKXIDzcccmHbQI0A6k5PzMdMloc0ElHfyOoX35A==
vue-runtime-helpers@^1.1.2: vue-runtime-helpers@^1.1.2:
version "1.1.2" version "1.1.2"
......
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