mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
chore(api,client): move most certs to legacy (#63140)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -55,7 +55,7 @@ test.describe('When the user has not accepted the Academic Honesty Policy', () =
|
||||
await page.goto('/settings#cert-responsive-web-design');
|
||||
|
||||
const claimCertButton = page.getByRole('button', {
|
||||
name: 'Claim Certification Responsive Web Design'
|
||||
name: 'Claim Certification Legacy Responsive Web Design V8'
|
||||
});
|
||||
await claimCertButton.click();
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ test.describe('Claim a certification - almost certified user', () => {
|
||||
}) => {
|
||||
await page.goto('/settings#cert-front-end-development-libraries');
|
||||
await page
|
||||
.getByRole('button', { name: 'Claim Certification Front End' })
|
||||
.getByRole('button', {
|
||||
name: 'Claim Certification Front End Development Libraries V8'
|
||||
})
|
||||
.click();
|
||||
// verify that an email is sent
|
||||
await expect(async () => {
|
||||
@@ -90,14 +92,14 @@ test.describe('Certification page - Non Microsoft', () => {
|
||||
await expect(linkedinLink).toBeVisible();
|
||||
await expect(linkedinLink).toHaveAttribute(
|
||||
'href',
|
||||
`https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=Responsive%20Web%20Design&organizationId=4831032&issueYear=2018&issueMonth=8&certUrl=https://freecodecamp.org/certification/certifieduser/responsive-web-design&certId=certifieduser-rwd`
|
||||
`https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=Legacy%20Responsive%20Web%20Design%20V8&organizationId=4831032&issueYear=2018&issueMonth=8&certUrl=https://freecodecamp.org/certification/certifieduser/responsive-web-design&certId=certifieduser-rwd`
|
||||
);
|
||||
|
||||
const twitterLink = certLink.getByTestId('twitter-share-btn');
|
||||
await expect(twitterLink).toBeVisible();
|
||||
await expect(twitterLink).toHaveAttribute(
|
||||
'href',
|
||||
`https://twitter.com/intent/tweet?text=I just earned the Responsive%20Web%20Design certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/certifieduser/responsive-web-design`
|
||||
`https://twitter.com/intent/tweet?text=I just earned the Legacy%20Responsive%20Web%20Design%20V8 certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/certifieduser/responsive-web-design`
|
||||
);
|
||||
|
||||
const projectLinks = certLink.getByTestId('project-links');
|
||||
|
||||
@@ -20,7 +20,9 @@ test.describe('Certification intro page', () => {
|
||||
|
||||
await page.goto('/learn/2022/responsive-web-design');
|
||||
|
||||
await expect(page).toHaveTitle('Responsive Web Design | freeCodeCamp.org');
|
||||
await expect(page).toHaveTitle(
|
||||
'Legacy Responsive Web Design V8 | freeCodeCamp.org'
|
||||
);
|
||||
await expect(superBlockText).toBeVisible();
|
||||
await expect(firstBlockText).toBeVisible();
|
||||
await expect(secondBlockText).not.toBeVisible();
|
||||
|
||||
@@ -4,27 +4,34 @@ import translations from '../client/i18n/locales/english/translations.json';
|
||||
|
||||
const certs = [
|
||||
{
|
||||
name: 'Responsive Web Design',
|
||||
name: 'Foundational C# with Microsoft',
|
||||
url: '/certification/certifieduser/foundational-c-sharp-with-microsoft'
|
||||
}
|
||||
];
|
||||
|
||||
const legacyCerts = [
|
||||
{
|
||||
name: 'Legacy Responsive Web Design V8',
|
||||
url: '/certification/certifieduser/responsive-web-design'
|
||||
},
|
||||
{
|
||||
name: 'JavaScript Algorithms and Data Structures',
|
||||
name: 'Legacy JavaScript Algorithms and Data Structures V8',
|
||||
url: '/certification/certifieduser/javascript-algorithms-and-data-structures-v8'
|
||||
},
|
||||
{
|
||||
name: 'Front End Development Libraries',
|
||||
name: 'Front End Development Libraries V8',
|
||||
url: '/certification/certifieduser/front-end-development-libraries'
|
||||
},
|
||||
{
|
||||
name: 'Data Visualization',
|
||||
name: 'Data Visualization V8',
|
||||
url: '/certification/certifieduser/data-visualization'
|
||||
},
|
||||
{
|
||||
name: 'Relational Database',
|
||||
name: 'Relational Database V8',
|
||||
url: '/certification/certifieduser/relational-database-v8'
|
||||
},
|
||||
{
|
||||
name: 'Back End Development and APIs',
|
||||
name: 'Back End Development and APIs V8',
|
||||
url: '/certification/certifieduser/back-end-development-and-apis'
|
||||
},
|
||||
{
|
||||
@@ -51,19 +58,12 @@ const certs = [
|
||||
name: 'College Algebra with Python',
|
||||
url: '/certification/certifieduser/college-algebra-with-python-v8'
|
||||
},
|
||||
{
|
||||
name: 'Foundational C# with Microsoft',
|
||||
url: '/certification/certifieduser/foundational-c-sharp-with-microsoft'
|
||||
}
|
||||
];
|
||||
|
||||
const legacyCerts = [
|
||||
{
|
||||
name: 'Legacy Front End',
|
||||
url: '/certification/certifieduser/legacy-front-end'
|
||||
},
|
||||
{
|
||||
name: 'Legacy JavaScript Algorithms and Data Structures',
|
||||
name: 'Legacy JavaScript Algorithms and Data Structures V7',
|
||||
url: '/certification/certifieduser/javascript-algorithms-and-data-structures'
|
||||
},
|
||||
{
|
||||
@@ -78,7 +78,10 @@ const legacyCerts = [
|
||||
name: 'Legacy Information Security and Quality Assurance',
|
||||
url: '/certification/certifieduser/information-security-and-quality-assurance'
|
||||
},
|
||||
{ name: 'Legacy Full Stack', url: '/certification/certifieduser/full-stack' }
|
||||
{
|
||||
name: 'Legacy Full Stack',
|
||||
url: '/certification/certifieduser/full-stack'
|
||||
}
|
||||
];
|
||||
|
||||
test.describe('Profile component', () => {
|
||||
|
||||
@@ -218,17 +218,17 @@ test.describe('JavaScript projects can be submitted and then viewed in /settings
|
||||
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Claim Certification Legacy JavaScript Algorithms and Data Structures'
|
||||
name: 'Claim Certification Legacy JavaScript Algorithms and Data Structures V7'
|
||||
})
|
||||
.click();
|
||||
|
||||
await alertToBeVisible(
|
||||
page,
|
||||
'@developmentuser, you have successfully claimed the Legacy JavaScript Algorithms and Data Structures Certification! Congratulations on behalf of the freeCodeCamp.org team!'
|
||||
'@developmentuser, you have successfully claimed the Legacy JavaScript Algorithms and Data Structures V7 Certification! Congratulations on behalf of the freeCodeCamp.org team!'
|
||||
);
|
||||
|
||||
const showCertLink = page.getByRole('link', {
|
||||
name: 'Show Certification Legacy JavaScript Algorithms and Data Structures'
|
||||
name: 'Show Certification Legacy JavaScript Algorithms and Data Structures V7'
|
||||
});
|
||||
await expect(showCertLink).toBeVisible();
|
||||
await expect(showCertLink).toHaveAttribute(
|
||||
|
||||
@@ -2,7 +2,10 @@ import { execSync } from 'child_process';
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
import translations from '../client/i18n/locales/english/translations.json';
|
||||
import { currentCertifications } from '../shared/config/certification-settings';
|
||||
import {
|
||||
currentCertifications,
|
||||
legacyCertifications as legacyCerts
|
||||
} from '../shared/config/certification-settings';
|
||||
import { alertToBeVisible } from './utils/alerts';
|
||||
|
||||
const settingsTestIds = {
|
||||
@@ -23,6 +26,10 @@ const settingsObject = {
|
||||
};
|
||||
|
||||
const certifications = [
|
||||
translations.certification.title['foundational-c-sharp-with-microsoft']
|
||||
];
|
||||
|
||||
const legacyCertifications = [
|
||||
translations.certification.title['responsive-web-design'],
|
||||
translations.certification.title[
|
||||
'javascript-algorithms-and-data-structures-v8'
|
||||
@@ -37,10 +44,6 @@ const certifications = [
|
||||
translations.certification.title['information-security-v7'],
|
||||
translations.certification.title['machine-learning-with-python-v7'],
|
||||
translations.certification.title['college-algebra-with-python-v8'],
|
||||
translations.certification.title['foundational-c-sharp-with-microsoft']
|
||||
];
|
||||
|
||||
const legacyCertifications = [
|
||||
translations.certification.title['legacy-front-end'],
|
||||
translations.certification.title['legacy-back-end'],
|
||||
translations.certification.title['legacy-data-visualization'],
|
||||
@@ -310,7 +313,7 @@ test.describe('Settings - New User', () => {
|
||||
});
|
||||
|
||||
const claimRwdCertButton = page.getByRole('button', {
|
||||
name: 'Claim Certification Responsive Web Design'
|
||||
name: 'Claim Certification Legacy Responsive Web Design V8'
|
||||
});
|
||||
|
||||
// Buttons for normal certs are enabled
|
||||
@@ -327,7 +330,8 @@ test.describe('Setting - Hash Navigation', () => {
|
||||
test('should scroll to certification sections when navigating with hash', async ({
|
||||
page
|
||||
}) => {
|
||||
for (const certSlug of currentCertifications) {
|
||||
const allCerts = [...currentCertifications, ...legacyCerts];
|
||||
for (const certSlug of allCerts) {
|
||||
await page.goto(`/settings#cert-${certSlug}`);
|
||||
|
||||
// Wait for scroll animation
|
||||
|
||||
Reference in New Issue
Block a user