-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(file-picker): support clearing files (VIV-1995) #1983
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1983 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 123 354 +231
Lines 1562 7028 +5466
Branches 108 914 +806
===========================================
+ Hits 1562 7028 +5466
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and very well needed feature. Thanks :)
/** | ||
* @internal | ||
*/ | ||
_dropzone?: Dropzone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to expose dropzone?
@@ -73,6 +73,7 @@ describe('vwc-file-picker', () => { | |||
unmountedElement.maxFileSize = 256; | |||
unmountedElement.maxFiles = 1; | |||
unmountedElement.accept = '.jpg'; | |||
unmountedElement.removeAllFiles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't removeAllFiles
tested in its own it
?
@@ -111,6 +112,17 @@ describe('vwc-file-picker', () => { | |||
addFiles([await generateFile('london.png', 1)]); | |||
expect(element.value).toBe('C:\\fakepath\\london.png'); | |||
}); | |||
|
|||
it('should remove all files when setting value to an empty string', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition :)
No description provided.