mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Fix broken tests, revert changes to error watch property
- causing breaking change in the tests
This commit is contained in:
parent
31a6d36e59
commit
5c6147ee47
@ -12,7 +12,7 @@
|
||||
<hc-avatar :user="user" class="profile-avatar" size="x-large"></hc-avatar>
|
||||
<div class="hc-attachments-upload-area">
|
||||
<div class="hc-drag-marker">
|
||||
<ds-icon v-if="hover" name="image" size="xxx-large"/>
|
||||
<ds-icon v-if="hover" name="image" size="xxx-large" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,9 +46,10 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
error: () => {
|
||||
error() {
|
||||
let that = this
|
||||
setTimeout(function() {
|
||||
this.error = false
|
||||
that.error = false
|
||||
}, 2000)
|
||||
},
|
||||
},
|
||||
|
||||
@ -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' }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user