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

Repair cart page including reinstated course api improvements #1885

Merged
merged 5 commits into from
Sep 12, 2023

Conversation

collinpreston
Copy link
Contributor

What are the relevant tickets?

#1876
#1869

Description (What does it do?)

  1. Reinstates: 1869: Course program api performance improvements #1872 & Department REST API #1877
  2. Fixes an issue when loading the cart page (https://mitxonline.mit.edu/cart/) with an item in the basket. Issue ref: https://mit-office-of-digital-learning.sentry.io/issues/4472765075/?alert_rule_id=8724694&alert_type=issue&notification_uuid=2bbf21e8-fcf4-46ec-944a-9cc1c91f3c80&project=5864687&referrer=slack

How can this be tested?

  1. Enroll into a course and proceed with certificate enrollment.
  2. When redirected to the cart page, ensure that the cart page loads as expected and there are no errors in the browser console.
  3. Through http://mitxonline.odl.local:8013/cms/, add a flexible price child page to the course page for the course you're enrolled in.
  4. Edit the course page and add the URL of the flexible price page to the URL field under the "price details" section.
  5. Refresh the cart page and ensure that you see a "Need financial assistance?" link.

Additional Context

This was caused because I was passing a course to isFinancialAssistanceAvailable, here: https://github.com/mitodl/mitxonline/blob/c87bdc15e75c6bae728749dedd5a91cae3755c8d/frontend/public/src/containers/pages/checkout/CartPage.js#L141C15-L141C15

@pdpinch
Copy link
Member

pdpinch commented Sep 12, 2023

Are there no tests for this code? I would have expected this to be caught by a test somewhere.

More forward-thinking, would type checking have helped?

@collinpreston
Copy link
Contributor Author

Are there no tests for this code? I would have expected this to be caught by a test somewhere.

More forward-thinking, would type checking have helped?

@pdpinch There are no tests for the cart page. Typing existed but did not help here. I can add tests but I don't think it will delay this by a day.

@jkachel jkachel self-assigned this Sep 12, 2023
@jkachel jkachel self-requested a review September 12, 2023 19:48
Copy link
Contributor

@jkachel jkachel left a comment

Choose a reason for hiding this comment

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

Functionality looks good to me. I tested by deleting the finaid form for one of my local programs, then adding a form to a course in the program, then deleting that and adding a form back to the program; all tests were successful. 👍

@collinpreston collinpreston merged commit 4e061cb into main Sep 12, 2023
@collinpreston collinpreston deleted the repair-cart-page-with-course-api-improvements branch September 12, 2023 19:57
@odlbot odlbot mentioned this pull request Sep 12, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants