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

chore: add subdirectory slug format for bootcamps #910

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

AfaqShuaib09
Copy link
Contributor

@AfaqShuaib09 AfaqShuaib09 commented Aug 31, 2023

PROD-3592

image

This PR adds the test in publisher to verify the URL slug format for bootcamps.

@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (ccd91ce) 66.96% compared to head (b5ab9eb) 66.97%.

❗ Current head b5ab9eb differs from pull request most recent head 815619b. Consider uploading reports for the commit 815619b to get more accurate results

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              
Files Changed Coverage Δ
src/data/constants/index.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

Comment on lines 133 to 152
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]);
},
);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@AfaqShuaib09 AfaqShuaib09 merged commit 8e7726a into master Sep 8, 2023
3 checks passed
@AfaqShuaib09 AfaqShuaib09 deleted the afaq/prod-3592 branch September 8, 2023 07:42
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.

3 participants