-
Notifications
You must be signed in to change notification settings - Fork 6
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
[7784] Create review errors page #4822
base: main
Are you sure you want to change the base?
Conversation
094184f
to
fb1c456
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4822 +/- ##
==========================================
- Coverage 95.99% 95.99% -0.01%
==========================================
Files 726 729 +3
Lines 15795 15846 +51
==========================================
+ Hits 15163 15211 +48
- Misses 632 635 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
25bc733
to
7ee0e66
Compare
app/controllers/bulk_update/trainees/review_errors_controller.rb
Outdated
Show resolved
Hide resolved
app/controllers/bulk_update/trainees/review_errors_controller.rb
Outdated
Show resolved
Hide resolved
app/controllers/bulk_update/trainees/review_errors_controller.rb
Outdated
Show resolved
Hide resolved
scenario "when I try to upload a file with errors" do | ||
when_i_visit_the_bulk_update_index_page | ||
and_i_click_the_bulk_add_trainees_page | ||
then_i_see_how_instructions_on_how_to_bulk_add_trainees | ||
and_i_see_the_empty_csv_link | ||
|
||
when_i_attach_a_file_with_invalid_rows | ||
and_i_click_the_upload_button | ||
when_the_background_job_is_run | ||
and_i_refresh_the_page | ||
then_i_see_the_review_page_with_no_errors | ||
|
||
when_the_background_job_is_run | ||
and_i_refresh_the_page | ||
then_i_see_the_review_page_with_validation_errors | ||
|
||
when_i_click_the_review_errors_link | ||
then_i_see_the_review_errors_page | ||
|
||
when_i_click_on_the_download_link | ||
then_i_receive_the_file | ||
|
||
when_i_return_to_the_review_errors_page | ||
and_i_attach_a_valid_file | ||
and_i_click_the_upload_button | ||
then_i_see_that_the_upload_is_processing | ||
end |
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 suggest to refactor the the bulk add trainees page is visible
scenario instead to avoid running similar assertions twice.
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 reason I ended up leaving this as a separate scenario was that it follows a different route through the flow. Because we can (re-)upload a corrected CSV through the review errors page, instead of going back to the normal page where we start the upload, it seemed like we would have to run two successful uploads to cover this in one scenario. Does that make sense? I am going to look at ways to reduce the duplication...
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.
If it is unavoidable to have a separate scenario no worries.
Adds a feature spec for the unhappy path in which validation fails and the user reviews errors.
The code that records row errors needs to be outside the DB transaction that creates trainee records because this gets rolled back in dry runs.
97569a2
to
3080e6a
Compare
Quality Gate passedIssues Measures |
Context
After attempting to a bulk upload trainee CSV, if there are validation errors the whole upload fails so the user needs to be able to review their errors.
Changes proposed in this pull request
Guidance to review
Opening this up for comments. I will continue to do some manual tests.
Important business
NB: Please notify the #twd_data_insights team and ask for a review if new fields are being added to analytics.yml