diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index 0a3eb776f9c..3158eb8bd1c 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -750,6 +750,7 @@ "verify": "Verify this certification at:", "issued": "Issued", "fulltext": "<0>This certifies that <1>{{user}} <2>successfully completed the <3>{{title}} <4>Developer Certification on {{time}} <5>representing approximately {{completionTime}} hours of work", + "fulltextNoHours": "<0>This certifies that <1>{{user}} <2>successfully completed the <3>{{title}} <4>Developer Certification on {{time}}", "project": { "heading-legacy-full-stack": "As part of this Legacy Full Stack certification, {{user}} completed the following certifications:", "heading": "As part of this certification, {{user}} built the following projects and got all automated test suites to pass:", diff --git a/client/src/assets/icons/freecodecamp.tsx b/client/src/assets/icons/freecodecamp.tsx index 1e1a28f8321..6bd143c84ec 100644 --- a/client/src/assets/icons/freecodecamp.tsx +++ b/client/src/assets/icons/freecodecamp.tsx @@ -5,6 +5,7 @@ function FreeCodeCampLogo( ): JSX.Element { return ( {
- +

placeholder

{{ user: displayName }} @@ -378,6 +385,7 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => { <>
Quincy Larson's Signature {
Julia Liusons's Signature { ) : (
Quincy Larson's Signature { if (!isCertName(certName)) return
Unknown Certification
; return ( -
+
{t( certName === 'Legacy Full Stack' ? 'certification.project.heading-legacy-full-stack' diff --git a/cypress/e2e/default/show-certification.ts b/cypress/e2e/default/show-certification.ts index 231e980abab..1887c3dc84e 100644 --- a/cypress/e2e/default/show-certification.ts +++ b/cypress/e2e/default/show-certification.ts @@ -1,16 +1,75 @@ -const certifiedUser = '/certification/certifieduser/responsive-web-design'; +const rwdCert = '/certification/certifieduser/responsive-web-design'; +const cSharpCert = + '/certification/certifieduser/foundational-c-sharp-with-microsoft'; + +const elements = { + fccLogo: "[data-cy='freeCodeCamp-logo']", + msLogo: "[data-cy='microsoft-logo']", + issueDate: "[data-cy='issue-date']", + quincySign: "[data-cy='quincy-signature']", + msSign: "[data-cy='microsoft-signature']", + solutionWidget: "[data-cy='solution-widget']" +}; + +const verifyRwdUrl = + 'https://freecodecamp.org/certification/certifieduser/responsive-web-design'; +const verifyCSharpUrl = + 'https://freecodecamp.org/certification/certifieduser/foundational-c-sharp-with-microsoft'; describe('A certification,', function () { before(() => { cy.task('seed', ['certified-user']); }); - describe('while viewing your own,', function () { - beforeEach(() => { + describe('while viewing your Responsive Web Design Certification,', function () { + before(() => { cy.login(); + cy.visit(rwdCert); }); + + it('should render a donate section', () => { + cy.get('.donation-section').should('exist'); + }); + + it('should have a freeCodeCamp logo', () => { + cy.get(elements.fccLogo).should('exist'); + }); + + it('should not have a Microsoft logo', () => { + cy.get(elements.msLogo).should('not.exist'); + }); + + it('should be issued with the submission date', () => { + const issued = `Developer Certification on August 3, 2018`; + cy.get(elements.issueDate).should('include.text', issued); + }); + + it('should be issued with the number of hours undertaken', () => { + const hours = '300 hours'; + cy.get('.information-container').should('include.text', hours); + }); + + it('should have a QR code', () => { + cy.get('.qr-code').should('exist'); + }); + + it("should have Quincy's signature", () => { + cy.get(elements.quincySign).should('exist'); + }); + + it('should not have a Microsoft signature', () => { + cy.get(elements.msSign).should('not.exist'); + }); + + it('should have the freeCodeCamp ribbon', () => { + cy.get('.ribbon').should('exist'); + }); + + it('should have a link to the certification', () => { + cy.get('.verify').should('include.text', verifyRwdUrl); + }); + it('should render a LinkedIn button', function () { - cy.visit(certifiedUser); cy.contains('Add this certification to my LinkedIn profile') .should('have.attr', 'href') .and( @@ -21,7 +80,6 @@ describe('A certification,', function () { }); it('should render a Twitter button', function () { - cy.visit(certifiedUser); cy.contains('Share this certification on Twitter').should( 'have.attr', 'href', @@ -29,22 +87,88 @@ describe('A certification,', function () { ); }); - it('should be issued with the submission date', () => { - cy.visit(certifiedUser); - const issued = `Developer Certification on August 3, 2018`; - cy.get('[data-cy=issue-date]').should('include.text', issued); - }); - - it('should be issued with the number of hours undertaken', () => { - cy.visit(certifiedUser); - const hours = '300 hours'; - cy.get('.information-container').should('include.text', hours); + it('should render the solution widget', () => { + cy.get(elements.solutionWidget).should('exist'); }); }); - describe("while viewing someone else's,", function () { + describe('while viewing your Foundational C# with Microsoft Certification,', function () { before(() => { - cy.visit(certifiedUser); + cy.login(); + cy.visit(cSharpCert); + }); + + it('should render a donate section', () => { + cy.get('.donation-section').should('exist'); + }); + + it('should have a freeCodeCamp logo', () => { + cy.get(elements.fccLogo).should('exist'); + }); + + it('should have a Microsoft logo', () => { + cy.get(elements.msLogo).should('exist'); + }); + + it('should be issued with the submission date', () => { + const issued = `Developer Certification on September 18, 2023`; + cy.get(elements.issueDate).should('include.text', issued); + }); + + it('should not show the number of hours undertaken', () => { + cy.get('.information-container').should('not.include.text', 'hours'); + }); + + it('should not have a QR code', () => { + cy.get('.qr-code').should('not.exist'); + }); + + it("should have Quincy's signature", () => { + cy.get(elements.quincySign).should('exist'); + }); + + it('should have a Microsoft signature', () => { + cy.get(elements.msSign).should('exist'); + }); + + it('should not have the freeCodeCamp ribbon', () => { + cy.get('.ribbon').should('not.exist'); + }); + + it('should have a link to the certification', () => { + cy.get('.verify').should('include.text', verifyCSharpUrl); + }); + + it('should render a LinkedIn button', function () { + cy.contains('Add this certification to my LinkedIn profile') + .should('have.attr', 'href') + .and( + 'match', + // eslint-disable-next-line max-len + /https:\/\/www\.linkedin\.com\/profile\/add\?startTask=CERTIFICATION_NAME&name=Foundational%20C%23%20with%20Microsoft&organizationId=4831032&issueYear=\d\d\d\d&issueMonth=\d\d?&certUrl=https:\/\/freecodecamp\.org\/certification\/certifieduser\/foundational-c-sharp-with-microsoft/ + ); + }); + + it('should render a Twitter button', function () { + cy.contains('Share this certification on Twitter').should( + 'have.attr', + 'href', + 'https://twitter.com/intent/tweet?text=I just earned the Foundational%20C%23%20with%20Microsoft certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/certifieduser/foundational-c-sharp-with-microsoft' + ); + }); + + it('should render the solution widget', () => { + cy.get(elements.solutionWidget).should('exist'); + }); + }); + + describe("while viewing someone else's Responsive Web Design Certification,", function () { + before(() => { + cy.visit(rwdCert); + }); + + it('should not render a donate section', () => { + cy.get('.donation-section').should('not.exist'); }); it('should display certificate', function () { @@ -61,5 +185,9 @@ describe('A certification,', function () { it('should not render a Twitter button', function () { cy.contains('Share this certification on Twitter').should('not.exist'); }); + + it('should render the solution widget', () => { + cy.get(elements.solutionWidget).should('exist'); + }); }); }); diff --git a/tools/scripts/seed/certified-user-data.js b/tools/scripts/seed/certified-user-data.js index 99db599de50..b9d269583a2 100644 --- a/tools/scripts/seed/certified-user-data.js +++ b/tools/scripts/seed/certified-user-data.js @@ -9916,6 +9916,228 @@ module.exports = { id: '606243f50267e718b1e755f4', challengeType: 7, files: [] + }, + { + id: '647f85d407d29547b3bee1bb', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-1.trophy?username=moT01&locale=en-us', + completedDate: 1695064765244 + }, + { + id: '647e239e8acb466c97ccbf05', + completedDate: 1695064829390 + }, + { + id: '647e238f8acb466c97ccbf04', + completedDate: 1695064849296 + }, + { + id: '647e23828acb466c97ccbf03', + completedDate: 1695064852639 + }, + { + id: '647e23788acb466c97ccbf02', + completedDate: 1695064856424 + }, + { + id: '647e235a8acb466c97ccbf00', + completedDate: 1695064861958 + }, + { + id: '647e236d8acb466c97ccbf01', + completedDate: 1695064864950 + }, + { + id: '647e21f88acb466c97ccbeeb', + completedDate: 1695064876515 + }, + { + id: '647e21c48acb466c97ccbee7', + completedDate: 1695064880298 + }, + { + id: '647e21ba8acb466c97ccbee6', + completedDate: 1695064883688 + }, + { + id: '647e22058acb466c97ccbeec', + completedDate: 1695064886045 + }, + { + id: '647e21df8acb466c97ccbee9', + completedDate: 1695064888237 + }, + { + id: '647e21eb8acb466c97ccbeea', + completedDate: 1695064890737 + }, + { + id: '647e21d08acb466c97ccbee8', + completedDate: 1695064894620 + }, + { + id: '647f87dc07d29547b3bee1bf', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-2.trophy?username=moT01&locale=en-us', + completedDate: 1695064900926 + }, + { + id: '647e21708acb466c97ccbee3', + completedDate: 1695064919032 + }, + { + id: '647e21658acb466c97ccbee2', + completedDate: 1695064922948 + }, + { + id: '647e214b8acb466c97ccbee0', + completedDate: 1695064926971 + }, + { + id: '647e218f8acb466c97ccbee5', + completedDate: 1695064931632 + }, + { + id: '647e1f4e8acb466c97ccbedf', + completedDate: 1695064937887 + }, + { + id: '647e217e8acb466c97ccbee4', + completedDate: 1695064943252 + }, + { + id: '647e21598acb466c97ccbee1', + completedDate: 1695064947396 + }, + { + id: '647f882207d29547b3bee1c0', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-3.trophy?username=moT01&locale=en-us', + completedDate: 1695064949460 + }, + { + id: '647e23188acb466c97ccbefa', + completedDate: 1695064958629 + }, + { + id: '647e23248acb466c97ccbefb', + completedDate: 1695064963473 + }, + { + id: '647e23508acb466c97ccbeff', + completedDate: 1695064967029 + }, + { + id: '647e232c8acb466c97ccbefc', + completedDate: 1695064971575 + }, + { + id: '647e23438acb466c97ccbefe', + completedDate: 1695064977375 + }, + { + id: '647e23368acb466c97ccbefd', + completedDate: 1695064981893 + }, + { + id: '647e230c8acb466c97ccbef9', + completedDate: 1695064984337 + }, + { + id: '647f867a07d29547b3bee1bc', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-4.trophy?username=moT01&locale=en-us', + completedDate: 1695064986634 + }, + { + id: '647e226a8acb466c97ccbef1', + completedDate: 1695065005456 + }, + { + id: '647e224b8acb466c97ccbeef', + completedDate: 1695065010582 + }, + { + id: '647e223c8acb466c97ccbeee', + completedDate: 1695065016929 + }, + { + id: '647e225e8acb466c97ccbef0', + completedDate: 1695065019309 + }, + { + id: '647e22338acb466c97ccbeed', + completedDate: 1695065024538 + }, + { + id: '647f877f07d29547b3bee1be', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-5.trophy?username=moT01&locale=en-us', + completedDate: 1695065026465 + }, + { + id: '647e22c08acb466c97ccbef7', + completedDate: 1695065036502 + }, + { + id: '647e22b38acb466c97ccbef6', + completedDate: 1695065038793 + }, + { + id: '647e22a08acb466c97ccbef5', + completedDate: 1695065045073 + }, + { + id: '647e228a8acb466c97ccbef3', + completedDate: 1695065047728 + }, + { + id: '647e22958acb466c97ccbef4', + completedDate: 1695065052249 + }, + { + id: '647e22778acb466c97ccbef2', + completedDate: 1695065057986 + }, + { + id: '647f86ff07d29547b3bee1bd', + solution: + 'https://learn.microsoft.com/api/gamestatus/achievements/learn.wwl.get-started-c-sharp-part-6.trophy?username=moT01&locale=en-us', + completedDate: 1695065060157 + }, + { + id: '647e22d18acb466c97ccbef8', + challengeType: 17, + completedDate: 1695065170436, + examResults: { + numberOfCorrectAnswers: 70, + numberOfQuestionsInExam: 80, + percentCorrect: 87.5, + passingPercent: 70, + passed: true, + examTimeInSeconds: 2195 + } + }, + { + completedDate: 1695065177436, + id: '647f7da207d29547b3bee1ba', + challengeType: 7, + files: [] + } + ], + completedExams: [ + { + id: '647e22d18acb466c97ccbef8', + challengeType: 17, + completedDate: 1695065170436, + examResults: { + numberOfCorrectAnswers: 70, + numberOfQuestionsInExam: 80, + percentCorrect: 87.5, + passingPercent: 70, + passed: true, + examTimeInSeconds: 2195 + } } ], portfolio: [],