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

HBW-349 Generate unique id for file_upload compoment #563

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

theodor85
Copy link
Contributor

@theodor85 theodor85 commented Jun 11, 2021

Uploading multiple files into different file_upload fields works correctly:
Peek 2021-06-11 13-31

As "Id" uuid is used:
Screenshot_20210611_133328

@theodor85 theodor85 force-pushed the HBW-349 branch 3 times, most recently from a6152c5 to fca1a48 Compare June 15, 2021 09:50
CHANGELOG.md Outdated
Comment on lines 8 to 9
### Features
- [#563](https://github.com/latera/homs/pull/563) Generate unique id for file_upload compoment
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### 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();
Copy link
Member

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.

Comment on lines 79 to 80
preview_another = page.all('.files-preview-row')[0]
form_group = page.all('.form-group')[0]
Copy link
Member

Choose a reason for hiding this comment

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

It's page.first

Comment on lines 81 to 83
file_input = form_group.find_field('homsOrderDataUploadedFileAnother', type: :file, visible: :hidden)

expect(file_input['name']).to eq('homsOrderDataUploadedFileAnother')
Copy link
Member

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)

Comment on lines 85 to 98
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'
Copy link
Member

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.

@theodor85 theodor85 force-pushed the HBW-349 branch 2 times, most recently from e7dd00a to 24d3170 Compare June 16, 2021 10:53
@theodor85 theodor85 marked this pull request as ready for review June 16, 2021 12:02
@hydra-billing-robot hydra-billing-robot merged commit a232068 into master Jun 16, 2021
@hydra-billing-robot hydra-billing-robot deleted the HBW-349 branch June 16, 2021 14:32
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.

3 participants