-
Notifications
You must be signed in to change notification settings - Fork 86
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
HBW-349 Generate unique id for file_upload compoment #563
Conversation
a6152c5
to
fca1a48
Compare
CHANGELOG.md
Outdated
### Features | ||
- [#563](https://github.com/latera/homs/pull/563) Generate unique id for file_upload compoment |
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.
### Features | |
- [#563](https://github.com/latera/homs/pull/563) Generate unique id for file_upload compoment | |
### Bugfixes | |
- [#563](https://github.com/latera/homs/pull/563) Generate unique id for file_upload compoment. |
@@ -80,11 +81,12 @@ modulejs.define('HBWFormFileUpload', ['React'], (React) => { | |||
} = this.props; | |||
|
|||
const { isDragActive } = this.state; | |||
const fileInputID = uuidv4(); |
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.
I think there is no need to generate it on every render, make it a component property.
preview_another = page.all('.files-preview-row')[0] | ||
form_group = page.all('.form-group')[0] |
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.
It's page.first
file_input = form_group.find_field('homsOrderDataUploadedFileAnother', type: :file, visible: :hidden) | ||
|
||
expect(file_input['name']).to eq('homsOrderDataUploadedFileAnother') |
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.
You have found this field by name, so you're testing Capybara now. Don't do that)
expect(preview_another).to have_content 'logo.svg' | ||
expect(preview_another).to have_content 'file.txt' | ||
expect(preview_another).to have_content 'file_with...me.pdf' |
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.
I think you should do something equivalent to your gif: attach files to both inputs in the same test.
e7dd00a
to
24d3170
Compare
Uploading multiple files into different

file_upload
fields works correctly:As "Id"

uuid
is used: