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

Reapply site address question changes with some modifications #7511

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

oliverjwroberts
Copy link
Contributor

@oliverjwroberts oliverjwroberts commented Feb 4, 2025

Description of change

Reapplies PR #7486 (commit 382debc) with some modifications. These include:

  • keeping the actual_uk_regions question and unnesting it
  • setting the address fields to the existing/entered values when (site_address_is_company_address == True && uk_company is not None) is False

Updated API PR can be found here.

Test instructions

For projects that have:

  • site_address_is_company_address === null: the radio buttons should be unselected. If no modifications are made, the frontend will set the address fields to existing values upon submission.
  • site_address_is_company_address === true && !uk_company): the yes option will be selected and show some help text prompting users to select a UK recipient company. Upon submission, the frontend will set site_address_is_company_address === true the address fields to existing values.
  • site_address_is_company_address === true && uk_company): the yes option will be selected and show the UK recipient company address fields. Upon submission, the frontend will set site_address_is_company_address === true the address fields to the UK company address.
  • site_address_is_company_address === false: the no option will be selected and address fields will appear for manual entry. Upon submission, the frontend will set site_address_is_company_address === false and the address fields to the values entered.

The actual_uk_regions field is now separate/unnested and should behave as usual.

Screenshots

image

Checklist

  • Has the branch been rebased to main?
  • Automated tests (Any of the following when applicable: Unit, Functional or End-to-End)
  • Manual compatibility testing (Browsers: Chrome, Firefox, Edge, Safari)

Reapplies PR #7486 (commit 382debc). Modifications include keeping the `actual_uk_regions` question and unnesting it.
@oliverjwroberts oliverjwroberts self-assigned this Feb 4, 2025
Copy link

cypress bot commented Feb 4, 2025

data-hub-frontend    Run #59124

Run Properties:  status check passed Passed #59124  •  git commit e8ab959904: Test transformation of actual_uk_regions field
Project data-hub-frontend
Branch Review feature/CLS2-1175-site-address-field-changes
Run status status check passed Passed #59124
Run duration 08m 05s
Commit git commit e8ab959904: Test transformation of actual_uk_regions field
Committer Oliver Roberts
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 4
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 74
View all changes introduced in this branch ↗︎

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.57%. Comparing base (e4b0ea2) to head (e8ab959).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...dules/Investments/Projects/Details/transformers.js 87.50% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7511   +/-   ##
=======================================
  Coverage   88.57%   88.57%           
=======================================
  Files        1144     1144           
  Lines       17789    17798    +9     
  Branches     5097     5105    +8     
=======================================
+ Hits        15756    15765    +9     
  Misses       2033     2033           

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

Copy link
Contributor

@cgsunkel cgsunkel left a comment

Choose a reason for hiding this comment

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

Feel free to disregard the comment if you know it won't work like that

Copy link
Contributor

@DeanElliott96 DeanElliott96 left a comment

Choose a reason for hiding this comment

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

LGTM, for the parts in the transformers that coverage highlighted, are they missing tests? Could a unit test be added for them?

@oliverjwroberts
Copy link
Contributor Author

LGTM, for the parts in the transformers that coverage highlighted, are they missing tests? Could a unit test be added for them?

Good spot.

I would argue

  if (siteAddressIsCompanyAddressBool === true && ukCompany) {
    return {

is covered by

it('should submit site address is company address is true and populate address fields when user selects yes and project has uk company', () => {

In regards to the other missed line, I've added a test for the actual_uk_regions field transformation.

@oliverjwroberts oliverjwroberts merged commit d815256 into main Feb 10, 2025
16 checks passed
@oliverjwroberts oliverjwroberts deleted the feature/CLS2-1175-site-address-field-changes branch February 10, 2025 11:18
chopkinsmade pushed a commit that referenced this pull request Feb 10, 2025
dredmonds pushed a commit that referenced this pull request Feb 10, 2025
* Reapply site address question changes with some modifications

Reapplies PR #7486 (commit 382debc). Modifications include keeping the `actual_uk_regions` question and unnesting it.

* Remove superfluous return

* Test transformation of actual_uk_regions field
dredmonds pushed a commit that referenced this pull request Feb 11, 2025
* Reapply site address question changes with some modifications

Reapplies PR #7486 (commit 382debc). Modifications include keeping the `actual_uk_regions` question and unnesting it.

* Remove superfluous return

* Test transformation of actual_uk_regions field
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