-
Notifications
You must be signed in to change notification settings - Fork 50
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
chore: add subdirectory slug format for bootcamps #910
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #910 +/- ##
==========================================
+ Coverage 66.96% 66.97% +0.01%
==========================================
Files 128 128
Lines 3200 3201 +1
Branches 927 927
==========================================
+ Hits 2143 2144 +1
Misses 1008 1008
Partials 49 49
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here. |
src/utils/utils.test.js
Outdated
it( | ||
'returns the old course url slug pattern when courseType is bootcamp and updatedSlugFlag is false', | ||
() => { | ||
const updatedSlugFlag = false; | ||
const courseType = BOOTCAMP_SLUG; | ||
|
||
expect( | ||
utils.getCourseUrlSlugPattern(updatedSlugFlag, 'external-source', courseType), | ||
).toEqual({ | ||
slug_format: COURSE_URL_SLUG_PATTERN_OLD, | ||
error_msg: 'Course URL slug contains lowercase letters, numbers, underscores, and dashes only.', | ||
}); | ||
}, | ||
); | ||
|
||
it( | ||
'returns the bootcamp subdirectory slug pattern when courseType is bootcamp and updatedSlugFlag is true', | ||
() => { | ||
const updatedSlugFlag = true; | ||
const courseType = BOOTCAMP_SLUG; | ||
|
||
expect( | ||
utils.getCourseUrlSlugPattern(updatedSlugFlag, 'external-source', courseType), | ||
).toEqual(JSON.parse(COURSE_URL_SLUGS_PATTERN)['external-source'][BOOTCAMP_SLUG]); | ||
}, | ||
); |
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.
You can use test.each to turn these into ddt style tests.
Or remove updatedSlugFlag & courseType variables and use the values directly in fn call.
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.
done
b5ab9eb
to
815619b
Compare
PROD-3592
This PR adds the test in publisher to verify the URL slug format for bootcamps.