feat(Uploader): add file result-type (#4680)
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user