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

EDSC-3773: Refactor buildAccessMethods.js #1767

Merged
merged 41 commits into from
Aug 29, 2024
Merged

EDSC-3773: Refactor buildAccessMethods.js #1767

merged 41 commits into from
Aug 29, 2024

Conversation

bnp26
Copy link
Collaborator

@bnp26 bnp26 commented Jul 17, 2024

Overview

What is the feature?

Refactored the buildAccessMethods.js file to pull out the 5 different logic blocks in order to make the file more readable and easier to modify (add new access methods in the future)

What is the Solution?

  • Moved out all the logic bocks in buildAccessMethods into their one files (1 for each logic block).
  • Created tests for each of those logic blocks and updated the buildAccessMethods to test that those methods get called the correct number of times and with the correct params.

What areas of the application does this impact?

List impacted areas.

Testing

Reproduction steps

  • Environment for testing: localhost
  • Collection to test with: N/A
  1. go to Test Collections and pick out 1 collection for each accessMethod type.
    EX:
    oPeNDAP: C1453188197-GES_DISC
    Harmony: C1595422627-ASF
    Echo Order: C179031504-LARC
    Echo Order: C1200382306-CMR_ONLY (In SIT, testing new feature allowing for multiple Echo Order/ESI services to show up to be downloaded)
    ESI: (The first good collection I found was in SIT C1200427107-EDF_DEV06)
    Download: (any of the top 4)
  2. navigate to locahost:8080/search?ee=prod
  3. for each collection, add some granules and click download
  4. Observe the downloads work correctly.

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

- Moved out all the logic bocks in buildAccessMethods into their one files (1 for each logic block).
- Created tests for each of those logic blocks and updated the buildAccessMethods to test that those methods get called the correct number of times and with the correct params.
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.30%. Comparing base (b0693f9) to head (fa630bf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1767      +/-   ##
==========================================
+ Coverage   93.27%   93.30%   +0.03%     
==========================================
  Files         749      754       +5     
  Lines       18208    18254      +46     
  Branches     4716     4722       +6     
==========================================
+ Hits        16983    17032      +49     
+ Misses       1140     1138       -2     
+ Partials       85       84       -1     

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

@bnp26 bnp26 requested a review from macrouch July 23, 2024 14:52
@macrouch
Copy link
Contributor

Please add a test for buildAccessMethods that shows indexes are correctly incremented when multiple service records exist for multiple types, including multiple order options assigned to an esi or echo orders service record

@dpesall dpesall self-requested a review August 19, 2024 03:48
Copy link
Contributor

@rushgeo rushgeo left a comment

Choose a reason for hiding this comment

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

Just need to nest some tests within the empty describe block, otherwise looks good to me.

@bnp26 bnp26 requested a review from rushgeo August 29, 2024 19:46
@bnp26 bnp26 merged commit aa65615 into main Aug 29, 2024
11 checks passed
@bnp26 bnp26 deleted the EDSC-3773 branch August 29, 2024 21:59
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.

6 participants