Commit 7253fc6b authored by NataliaTepluhina's avatar NataliaTepluhina Committed by Jose Vargas

Fixed legacy test

parent 05fae5ac
...@@ -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();
}, },
......
...@@ -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);
}); });
}); });
......
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