-
Notifications
You must be signed in to change notification settings - Fork 0
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/modify file input #11
Conversation
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.
The tests pass but they seem to be throwing a lot of warnings.
stderr | src/components/BnFileInput/BnFiIeInput.spec.ts > BnFileInput > v-model should work with array
[Vue warn]: Unhandled error during execution of native event handler
at <BnFileInput modelValue= [] onUpdate:modelValue=fn<onUpdate:modelValue> name="image" ... >
at <Form onSubmit=fn<bound submit> validation-schema= {} >
at <Anonymous ref="VTU_COMPONENT" >
at <VTUROOT>
Error: Uncaught [ReferenceError: DataTransfer is not defined]
b2b1a2c
to
c90debe
Compare
I had to mock the DataTransfer object, so I created a folder called 'mocks' and inside it, I generated a file with the mocked DataTransfer. |
c90debe
to
d8bea31
Compare
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.
💯
Context
Banano is a component library intended for use in Platanus projects. The BnFileInput component acts as a file input, allowing the use of v-model. In the initial implementation, this component only accepted a list of files, but did not handle single files.
This PR
This PR enables BnFileInput to accept single files. It handles multiple scenarios, including cases where the value exists as either a File list or a single file, as well as cases where the value does not exist. Additionally, a change has been made to set the "touched" value when the dialog is open. Previously, if the dialog was open but the user didn't select any files, the validation wouldn't appear.
Furthermore, tests have been added to cover all the cases present in the component.