mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
test: fix codecov 100% (#28892)
This commit is contained in:
parent
005627e4a4
commit
9daf50f3a9
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: test
|
||||
name: ✅ test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
|
@ -183,17 +183,13 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (pr
|
||||
|
||||
if (removedFileList) {
|
||||
currentFile = { ...file, status: 'removed' };
|
||||
fileList?.some(item => {
|
||||
fileList?.forEach(item => {
|
||||
const matchKey = currentFile.uid !== undefined ? 'uid' : 'name';
|
||||
if (item[matchKey] === currentFile[matchKey]) {
|
||||
item.status = 'removed';
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (upload.current) {
|
||||
upload.current.abort(currentFile);
|
||||
}
|
||||
upload.current?.abort(currentFile);
|
||||
|
||||
onInternalChange({
|
||||
file: currentFile,
|
||||
|
@ -350,6 +350,7 @@ describe('Upload', () => {
|
||||
const targetItem = removeFileItem(file, fileList);
|
||||
expect(targetItem).toEqual(fileList.slice(0, 2));
|
||||
});
|
||||
|
||||
it('should not be able to remove fileItem', () => {
|
||||
const file = { uid: '-3', name: 'item.jpg' };
|
||||
const fileList = [
|
||||
|
@ -494,6 +494,7 @@ describe('Upload List', () => {
|
||||
);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should support custom onClick in custom icon', async () => {
|
||||
const handleRemove = jest.fn();
|
||||
const handleChange = jest.fn();
|
||||
|
Loading…
Reference in New Issue
Block a user