-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
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. 🚨 Try these New Features:
|
6ac97cf
to
af68ad1
Compare
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.
Just some nits around testing on first read-through
{ | ||
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, | ||
}, |
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.
[curious] Is it worth throwing in a test case where a restricted run is isMarketable
false? Would that every happen (or be surfaced)
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.
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.
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` })), | ||
}, | ||
}; |
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.
[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.
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, |
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.
[nit] Migrating this to the top of the file for possible reuse
ENT-9410