-
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: Improve code coverage 3 #1065
Conversation
@@ -6,6 +6,36 @@ import { queryCanRedeem } from '../queries'; | |||
import useEnterpriseCustomer from './useEnterpriseCustomer'; | |||
import useLateRedemptionBufferDays from './useLateRedemptionBufferDays'; | |||
|
|||
export function transformCourseRedemptionEligibility({ |
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.
Opted to abstract this logic outside of the hook into a separate function. Reason being is more efficient mocking in tests by passing in the mocked and fetched metadata with the expectation that the data we pass in prior to the transform should match the post transform output.
fd9c80e
to
bafddf3
Compare
jest.clearAllMocks(); | ||
}); | ||
it.each([ | ||
/** |
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.
Helpful comments to parse these mock data cases :)
src/components/app/data/hooks/usePassLearnerCsodParams.test.jsx
Outdated
Show resolved
Hide resolved
49a3004
to
25740a4
Compare
d6bf0d9
to
29f59b4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1065 +/- ##
==========================================
- Coverage 84.87% 84.67% -0.20%
==========================================
Files 320 386 +66
Lines 6399 7947 +1548
Branches 1552 1921 +369
==========================================
+ Hits 5431 6729 +1298
- Misses 941 1160 +219
- Partials 27 58 +31 ☔ View full report in Codecov by Sentry. |
29f59b4
to
2e47a01
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 2 small nits, but lgtm.
Adds additional tests to improve coverage:
useBrowseAndRequest
useCourseRedemptionEligibility
useEnterpriseCourseEnrollments
useIsAssignmnetOnlyLearner
useLateRedemptionBuffer
usePassLearenrCsodParam
Updates hooks in course/data to more accurately test the intended behavior of the hooks.
Final iteration of improve code cov of the following PRs,
#1060
#1055
For all changes
Only if submitting a visual change