mirror of https://github.com/ElemeFE/element
Upload: fix type error in unit test (#15979)
parent
b8f2007afa
commit
f843a0bffc
|
@ -1,13 +1,13 @@
|
||||||
import { createVue, destroyVM } from '../util.js';
|
import { createVue, destroyVM } from '../util.js';
|
||||||
import ajax from 'packages/upload/src/ajax';
|
import ajax from 'packages/upload/src/ajax';
|
||||||
const noop = () => {
|
|
||||||
};
|
const noop = () => {};
|
||||||
const option = {
|
const option = {
|
||||||
onSuccess: noop,
|
onSuccess: noop,
|
||||||
onProgress: noop,
|
onProgress: noop,
|
||||||
data: { a: 'abc', b: 'bcd' },
|
data: { a: 'abc', b: 'bcd' },
|
||||||
filename: 'file.png',
|
filename: 'file.png',
|
||||||
file: 'foo',
|
file: new File([JSON.stringify('foo')], {type: 'image/png'}),
|
||||||
action: '/upload',
|
action: '/upload',
|
||||||
headers: { region: 'shanghai' }
|
headers: { region: 'shanghai' }
|
||||||
};
|
};
|
||||||
|
@ -35,7 +35,6 @@ describe('ajax', () => {
|
||||||
it('request width header', done => {
|
it('request width header', done => {
|
||||||
ajax(option);
|
ajax(option);
|
||||||
expect(requests[0].requestHeaders).to.eql({
|
expect(requests[0].requestHeaders).to.eql({
|
||||||
// 'X-Requested-With': 'XMLHttpRequest',
|
|
||||||
region: 'shanghai'
|
region: 'shanghai'
|
||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
|
|
Loading…
Reference in New Issue