Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RichardHelm
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d61b119) to head (5613ba9).
Report is 1140 commits behind head on main.

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YonatanKra YonatanKra self-requested a review November 7, 2024 08:19
@YonatanKra YonatanKra self-assigned this Nov 7, 2024
Copy link
Contributor

@YonatanKra YonatanKra left a 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 :)

Comment on lines +53 to +56
/**
* @internal
*/
_dropzone?: Dropzone;
Copy link
Contributor

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();
Copy link
Contributor

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 () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants