Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Dec 10, 2024
1 parent 8bda8f0 commit 59e21c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/upload/__test__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,14 @@ describe('Upload', () => {
props,
});

const target = wrapper.findComponent(Upload);
triggerUploadFile(wrapper, [
new File([new ArrayBuffer(1023)], 'foo.png', {
type: 'image/png',
}),
]);
expect(wrapper.vm.uploadFiles.length).toBe(1);

target.vm.uploadFiles = [];
wrapper.vm.uploadFiles = [];
triggerUploadFile(wrapper, [
new File([new ArrayBuffer(1025)], 'foo.png', {
type: 'image/png',
Expand Down
5 changes: 2 additions & 3 deletions src/upload/upload.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, computed, toRefs } from 'vue';
import { defineComponent, ref, computed } from 'vue';
import { AddIcon, LoadingIcon, CloseIcon, CloseCircleIcon } from 'tdesign-icons-vue-next';
import TImage from '../image';
import TImageViewer from '../image-viewer';
Expand All @@ -14,7 +14,6 @@ const { prefix } = config;
export default defineComponent({
name: `${prefix}-upload`,
components: {
AddIcon,
TImage,
},
props: UploadProps,
Expand Down Expand Up @@ -147,7 +146,7 @@ export default defineComponent({
))}
{content()}
<input
ref="inputRef"
ref={inputRef}
value={props.files}
type="file"
multiple={props.multiple}
Expand Down

0 comments on commit 59e21c5

Please sign in to comment.