feat(Uploader): add file result-type (#4680)

This commit is contained in:
neverland
2019-10-10 20:09:22 +08:00
committed by GitHub
parent 1d9b3e2013
commit 1044179354
5 changed files with 60 additions and 9 deletions
+16 -1
View File
@@ -37,7 +37,7 @@ test('disabled', () => {
expect(afterRead).toHaveBeenCalledTimes(0);
});
it('read text', done => {
it('result-type as text', done => {
const wrapper = mount(Uploader, {
propsData: {
resultType: 'text',
@@ -51,6 +51,21 @@ it('read text', done => {
wrapper.vm.onChange(file);
});
it('result-type as file', done => {
const wrapper = mount(Uploader, {
propsData: {
resultType: 'file',
afterRead: readFile => {
expect(readFile.file).toBeTruthy();
expect(readFile.content).toBeFalsy();
done();
}
}
});
wrapper.vm.onChange(file);
});
it('set input name', done => {
const wrapper = mount(Uploader, {
propsData: {