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

Fixed legacy test

parent 05fae5ac
......@@ -168,7 +168,7 @@ export default {
// if this upload resulted in a new version being created, redirect user to the latest version
if (!this.isLatestVersion) {
this.$router.push({ name: DESIGNS_ROUTE_NAME });
this.$router.push({ name: DESIGNS_ROUTE_NAME }, () => {});
}
this.resetFilesToBeSaved();
},
......
......@@ -450,16 +450,15 @@ describe('Design management index page', () => {
describe('on non-latest version', () => {
beforeEach(() => {
createComponent({ designs: mockDesigns, allVersions: [mockVersion] });
});
router.replace({
it('does not render design checkboxes', async () => {
await router.replace({
name: DESIGNS_ROUTE_NAME,
query: {
version: '2',
},
});
});
it('does not render design checkboxes', () => {
expect(findDesignCheckboxes()).toHaveLength(0);
});
......@@ -482,16 +481,9 @@ describe('Design management index page', () => {
});
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 = {
files: [{ name: 'image.png', type: 'image/png' }],
getData: () => 'test.png',
......@@ -532,11 +524,12 @@ describe('Design management index page', () => {
});
describe('when navigating', () => {
it('ensures fullscreen layout is not applied', () => {
it('ensures fullscreen layout is not applied', async () => {
createComponent(true);
wrapper.vm.$router.push('/designs');
expect(mockPageEl.classList.remove).toHaveBeenCalledTimes(1);
await wrapper.vm.$router.replace('/');
await wrapper.vm.$router.replace('/designs');
expect(mockPageEl.classList.remove).toHaveBeenCalledTimes(2);
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