test: update upload action

pull/165/head
tjz 7 years ago
parent c2a2ded9ca
commit e7ab83cd86

@ -29,7 +29,7 @@ describe('Upload', () => {
const data = jest.fn() const data = jest.fn()
const props = { const props = {
propsData: { propsData: {
action: 'http://jsonplaceholder.typicode.com/posts/', action: 'http://upload.com',
beforeUpload: () => new Promise(resolve => beforeUpload: () => new Promise(resolve =>
setTimeout(() => resolve('success'), 100) setTimeout(() => resolve('success'), 100)
), ),
@ -48,7 +48,6 @@ describe('Upload', () => {
}, },
sync: false, sync: false,
} }
Upload.props
const wrapper = mount(Upload, props) const wrapper = mount(Upload, props)
setTimeout(() => { setTimeout(() => {
const mockFile = new File(['foo'], 'foo.png', { const mockFile = new File(['foo'], 'foo.png', {
@ -66,7 +65,7 @@ describe('Upload', () => {
const data = jest.fn() const data = jest.fn()
const props = { const props = {
propsData: { propsData: {
action: 'http://jsonplaceholder.typicode.com/posts/', action: 'http://upload.com',
beforeUpload: () => false, beforeUpload: () => false,
data, data,
}, },
@ -100,7 +99,7 @@ describe('Upload', () => {
let lastPercent = -1 let lastPercent = -1
const props = { const props = {
propsData: { propsData: {
action: 'http://jsonplaceholder.typicode.com/posts/', action: 'http://upload.com',
}, },
listeners: { listeners: {
change: ({ file }) => { change: ({ file }) => {
@ -139,7 +138,7 @@ describe('Upload', () => {
const data = jest.fn() const data = jest.fn()
const props = { const props = {
propsData: { propsData: {
action: 'http://jsonplaceholder.typicode.com/posts/', action: 'http://upload.com',
beforeUpload () {}, beforeUpload () {},
data, data,
}, },

Loading…
Cancel
Save