Skip to content

Commit

Permalink
Upload Tests/Features/Bugs (#1918)
Browse files Browse the repository at this point in the history
* test(Guide): update unit tests; fix content warning

* feat(upload): add some unit tests and features

* feat(upload): unit tests & features & bugs

* test(upload): image card

* test(upload): multipleFlowList unit tests

* test(upload): upload DraggerFile and CustomFile tests

* test(upload): add drag file unit tests

* feat: update common

* test(upload): mock request

* test: update snapshots

* test: update snapshots
  • Loading branch information
chaishi authored Jan 29, 2023
1 parent c8ddac1 commit 4fc7ea9
Show file tree
Hide file tree
Showing 28 changed files with 3,544 additions and 1,903 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"lint-staged": "^12.1.6",
"markdown-it-fence": "^0.1.3",
"mockdate": "^3.0.5",
"msw": "^1.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"postcss": "^8.3.11",
Expand Down
10 changes: 7 additions & 3 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ export interface UploadDisplayDragEvents {
}

export type ImageEvent<T = any> = SyntheticEvent<T>;
/** 通用全局类型 */

/**
* 通用全局类型
* */
export type PlainObject = { [key: string]: any };

export type OptionData = {
label?: string;
value?: string | number;
} & { [key: string]: any };
} & PlainObject;

export type TreeOptionData<T = string | number> = {
children?: Array<TreeOptionData<T>>;
Expand All @@ -50,7 +54,7 @@ export type TreeOptionData<T = string | number> = {
text?: string;
/** option value */
value?: T;
} & { [key: string]: any };
} & PlainObject;

export type SizeEnum = 'small' | 'medium' | 'large';

Expand Down
2 changes: 1 addition & 1 deletion src/guide/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const Guide = (props: GuideProps) => {
current: innerCurrent,
total: stepsTotal,
};
renderBody = React.cloneElement(content as any, contentProps);
renderBody = isFunction(content) ? content(contentProps) : content;
} else {
renderBody = renderPopupContent();
}
Expand Down
Loading

0 comments on commit 4fc7ea9

Please sign in to comment.