forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow-certificate-else.spec.ts
28 lines (23 loc) · 1.13 KB
/
show-certificate-else.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { test, expect, type Page } from '@playwright/test';
test.describe('Show certification else', () => {
let page: Page;
test.use({ storageState: { cookies: [], origins: [] } });
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await page.goto('/certification/certifieduser/responsive-web-design');
});
test('while viewing someone else, should display the certificate information', async () => {
await expect(page.getByTestId('successful-completion')).toBeVisible();
await expect(page.getByTestId('certification-title')).toBeVisible();
await expect(page.getByTestId('issue-date')).toContainText(
'Developer Certification on August 3, 2018'
);
});
test('while viewing someone else, should not render a LinkedIn button and Twitter button', async () => {
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();
});
});