-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Upload): image-card support imageProps (#3317)
* feat(upload): image-card support imageProps #3271 * test(upload): update test snap * chore: text starts with lowercase letters --------- Co-authored-by: Heising <[email protected]>
- Loading branch information
1 parent
f59fa5f
commit 6f1a2f1
Showing
8 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { render, vi, mockDelay } from '@test/utils'; | ||
import Upload from '../upload'; | ||
|
||
const files = [ | ||
{ | ||
url: 'https://tdesign.gtimg.com/demo/demo-image-1.png', | ||
name: 'default.jpeg', | ||
status: 'success', | ||
}, | ||
]; | ||
|
||
describe('upload 组件测试', () => { | ||
afterEach(() => { | ||
vi.restoreAllMocks(); | ||
}); | ||
|
||
test('imageProps', async () => { | ||
const { container } = render( | ||
<Upload | ||
files={files} | ||
action="//service-bv448zsw-1257786608.gz.apigw.tencentcs.com/api/upload-demo" | ||
theme="image" | ||
accept="image/*" | ||
imageProps={{ | ||
className: 'tdesign', | ||
}} | ||
/>, | ||
); | ||
|
||
await mockDelay(); | ||
expect(container).toBeInTheDocument(); | ||
expect(container.querySelector('.tdesign')).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.