mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Remove unused prop, add error boundary handling
This commit is contained in:
parent
db0ad1a315
commit
8e96179b33
@ -7,7 +7,6 @@
|
|||||||
:use-custom-slot="true"
|
:use-custom-slot="true"
|
||||||
:options="dropzoneOptions"
|
:options="dropzoneOptions"
|
||||||
@vdropzone-error="verror"
|
@vdropzone-error="verror"
|
||||||
@vdropzone-thumbnail="thumbnail"
|
|
||||||
>
|
>
|
||||||
<div class="dz-message" @mouseover="hover = true" @mouseleave="hover = false">
|
<div class="dz-message" @mouseover="hover = true" @mouseleave="hover = false">
|
||||||
<hc-avatar :user="user" class="profile-avatar" size="x-large"></hc-avatar>
|
<hc-avatar :user="user" class="profile-avatar" size="x-large"></hc-avatar>
|
||||||
|
|||||||
@ -68,5 +68,15 @@ describe('Upload', () => {
|
|||||||
jest.runAllTimers()
|
jest.runAllTimers()
|
||||||
expect(wrapper.vm.error).toEqual(false)
|
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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user