diff --git a/webapp/components/Upload/index.vue b/webapp/components/Upload/index.vue index f59c86483..f7f730632 100644 --- a/webapp/components/Upload/index.vue +++ b/webapp/components/Upload/index.vue @@ -7,7 +7,6 @@ :use-custom-slot="true" :options="dropzoneOptions" @vdropzone-error="verror" - @vdropzone-thumbnail="thumbnail" >
diff --git a/webapp/components/Upload/spec.js b/webapp/components/Upload/spec.js index 68c19793c..8ee5f6046 100644 --- a/webapp/components/Upload/spec.js +++ b/webapp/components/Upload/spec.js @@ -68,5 +68,15 @@ describe('Upload', () => { jest.runAllTimers() expect(wrapper.vm.error).toEqual(false) }) + + it('shows an error toaster when the apollo mutation rejects', async () => { + // calls vddrop twice because of how mockResolvedValueOnce works in jest + // the first time the mock function is called it will resolve, calling it a + // second time will cause it to fail(with this implementation) + // https://jestjs.io/docs/en/mock-function-api.html#mockfnmockresolvedvalueoncevalue + await wrapper.vm.vddrop([{ filename: 'avatar.jpg' }]) + await wrapper.vm.vddrop([{ filename: 'avatar.jpg' }]) + expect(mocks.$toast.error).toHaveBeenCalledTimes(1) + }) }) })