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

feat: display restricted runs on course about page #1220

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pwnage101
Copy link
Contributor

ENT-9410

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.43%. Comparing base (7bef328) to head (af68ad1).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...s/app/data/hooks/useCourseRedemptionEligibility.js 75.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1220      +/-   ##
==========================================
+ Coverage   88.41%   88.43%   +0.01%     
==========================================
  Files         399      399              
  Lines        8502     8548      +46     
  Branches     2088     2102      +14     
==========================================
+ Hits         7517     7559      +42     
- Misses        942      946       +4     
  Partials       43       43              

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


🚨 Try these New Features:

Copy link
Member

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

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

Just some nits around testing on first read-through

Comment on lines +61 to +69
{
isMarketable: true,
availability: 'Current',
enrollmentStart: dayjs().add(-10, 'day').toISOString(),
enrollmentEnd: dayjs().add(15, 'day').toISOString(),
key: 'course-v1:edX+DemoX+2T2020restricted.b',
isEnrollable: true,
restrictionType: ENTERPRISE_RESTRICTION_TYPE,
},
Copy link
Member

Choose a reason for hiding this comment

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

[curious] Is it worth throwing in a test case where a restricted run is isMarketable false? Would that every happen (or be surfaced)

Copy link
Contributor Author

@pwnage101 pwnage101 Nov 18, 2024

Choose a reason for hiding this comment

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

Oh, so the intention now from Phoenix team is that isMarketable can be respected at face value. We should never allow visibility of restricted runs that have isMarketable = false. That is already consistent with all of our current assumptions and tests, so I didn't think it needed a specific test case.

Comment on lines +194 to +203
const courseRunsMatrix = {
available: {
assigned: availableCourseRuns.map(r => ({ ...r, key: `${r.key}assigned` })),
unassigned: availableCourseRuns.map(r => ({ ...r, key: `${r.key}unassigned` })),
},
unavailable: {
assigned: unavailableCourseRuns.map(r => ({ ...r, key: `${r.key}assigned` })),
unassigned: unavailableCourseRuns.map(r => ({ ...r, key: `${r.key}unassigned` })),
},
};
Copy link
Member

Choose a reason for hiding this comment

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

[nit/curious] I think this is a great idea to defined a set of course runs which are considered assigned and unassigned, but I am wondering if we should be dependent on the mocked value for redeemablePolicies to determine if a specific run is assigned or unassigned.

Comment on lines +205 to +216
const assignedCourseRuns = [
...courseRunsMatrix.available.assigned,
...courseRunsMatrix.unavailable.assigned,
];
const availableAndAssignedCourseRuns = [
...courseRunsMatrix.available.assigned,
];
const allCourseRuns = [
...courseRunsMatrix.available.assigned,
...courseRunsMatrix.available.unassigned,
...courseRunsMatrix.unavailable.assigned,
...courseRunsMatrix.unavailable.unassigned,
Copy link
Member

Choose a reason for hiding this comment

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

[nit] Migrating this to the top of the file for possible reuse

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.

2 participants