mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-14 07:00:56 -05:00
feat: convert "show certification" tests to Playwright (#54899)
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
const rwdCert = '/certification/certifieduser/responsive-web-design';
|
||||
|
||||
const elements = {
|
||||
fccLogo: "[data-cy='freeCodeCamp-logo']",
|
||||
msLogo: "[data-cy='microsoft-logo']",
|
||||
issueDate: "[data-cy='issue-date']",
|
||||
quincySignature: "[data-cy='quincy-signature']",
|
||||
msSignature: "[data-cy='microsoft-signature']",
|
||||
solutionWidget: "[data-cy='solution-widget']"
|
||||
};
|
||||
|
||||
describe('A certification,', function () {
|
||||
before(() => {
|
||||
cy.task('seed', ['certified-user']);
|
||||
});
|
||||
|
||||
describe("while viewing someone else's Responsive Web Design Certification,", function () {
|
||||
it('should only render public components', () => {
|
||||
cy.visit(rwdCert);
|
||||
|
||||
cy.get('.donation-section').should('not.exist');
|
||||
cy.contains('successfully completed');
|
||||
cy.contains('Responsive Web Design');
|
||||
cy.contains('Add this certification to my LinkedIn profile').should(
|
||||
'not.exist'
|
||||
);
|
||||
cy.contains('Share this certification on Twitter').should('not.exist');
|
||||
cy.get(elements.solutionWidget).should('be.visible');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -20,4 +20,8 @@ test.describe('Show certification else', () => {
|
||||
await expect(page.getByTestId('linkedin-share-btn')).toBeHidden();
|
||||
await expect(page.getByTestId('twitter-share-btn')).toBeHidden();
|
||||
});
|
||||
|
||||
test('while viewing someone else, it should not show the donation section', async () => {
|
||||
await expect(page.getByRole('button', { name: 'Donate' })).toBeHidden();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user