Follow "folder with spec and component" convention

This commit is contained in:
Robert Schäfer 2019-05-18 13:46:32 +02:00
parent bb5b24cf07
commit b7632ed1fa
2 changed files with 22 additions and 3 deletions

View File

@ -5,7 +5,7 @@
ref="el"
:options="dropzoneOptions"
:include-styling="false"
:style="{ backgroundImage: backgroundImage(`${user.avatar}`)}"
:style="backgroundImage"
@vdropzone-thumbnail="thumbnail"
>
<!-- <slot></slot> -->
@ -35,8 +35,11 @@ export default {
}
},
computed: {
backgroundImage: () => avatar => {
return `url(${avatar})`
backgroundImage() {
const { avatar } = this.user || {}
return {
backgroundImage: `url(${avatar})`
}
}
},
methods: {

View File

@ -0,0 +1,16 @@
import { shallowMount } from '@vue/test-utils'
import Upload from '.'
describe('Upload', () => {
let wrapper
beforeEach(() => {
wrapper = shallowMount(Upload, {})
})
it('renders', () => {
expect(wrapper.is('div')).toBe(true)
})
// TODO: add more test cases in this file
})