Merge branch '399-user-profile-image-uploads' of github.com:Human-Connection/Human-Connection into 399-user-profile-image-uploads

This commit is contained in:
Matt Rider 2019-05-20 15:39:57 -03:00
commit 3df7f588d2
2 changed files with 22 additions and 4 deletions

View File

@ -5,8 +5,7 @@
ref="el"
:options="dropzoneOptions"
:include-styling="false"
:style="{ backgroundImage: backgroundImage(`${user.avatar}`)}"
@vdropzone-error="verror"
:style="backgroundImage"
@vdropzone-thumbnail="thumbnail"
@vdropzone-drop="vddrop"
@vdropzone-success="vsuccess"
@ -35,8 +34,11 @@ export default {
}
},
computed: {
backgroundImage: () => avatar => {
return `url(${avatar})`
backgroundImage() {
const { avatar } = this.user || {}
return {
backgroundImage: `url(${avatar})`
}
}
},
mounted() {

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
})