diff --git a/webapp/components/Upload/index.vue b/webapp/components/Upload/index.vue index 2548b08be..79ae80211 100644 --- a/webapp/components/Upload/index.vue +++ b/webapp/components/Upload/index.vue @@ -12,7 +12,7 @@
- +
@@ -46,9 +46,10 @@ export default { } }, watch: { - error: () => { + error() { + let that = this setTimeout(function() { - this.error = false + that.error = false }, 2000) }, }, diff --git a/webapp/components/Upload/spec.js b/webapp/components/Upload/spec.js index b81babb6e..68c19793c 100644 --- a/webapp/components/Upload/spec.js +++ b/webapp/components/Upload/spec.js @@ -35,26 +35,6 @@ describe('Upload', () => { }, } - const fileSuccess = { - filename: 'avatar.jpg', - previewElement: { - classList: { - remove: jest.fn(), - add: jest.fn(), - }, - querySelectorAll: jest.fn().mockReturnValue([ - { - alt: '', - style: { - 'background-image': '/api/generic.jpg', - }, - }, - ]), - }, - } - - const dataUrl = 'avatar.jpg' - beforeEach(() => { jest.useFakeTimers() wrapper = shallowMount(Upload, { localVue, propsData, mocks }) @@ -69,11 +49,6 @@ describe('Upload', () => { expect(mocks.$apollo.mutate).toHaveBeenCalledTimes(1) }) - it('thumbnail', () => { - wrapper.vm.thumbnail(fileSuccess, dataUrl) - expect(fileSuccess.previewElement.classList.add).toHaveBeenCalledTimes(1) - }) - describe('error handling', () => { const message = 'File upload failed' const fileError = { status: 'error' }