mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-20 12:03:11 -04:00
test(e2e, playwright): add test for link properties in challenge-description (#52401)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -7,13 +7,17 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
|
||||
test.describe('Challenge Description Component Tests', () => {
|
||||
test('should be visible', async ({ page }) => {
|
||||
test('should display the content correctly', async ({ page }) => {
|
||||
const challengeDescription = page.getByTestId('challenge-description');
|
||||
await expect(challengeDescription).toBeVisible();
|
||||
});
|
||||
|
||||
test('should contain text', async ({ page }) => {
|
||||
const challengeDescription = page.getByTestId('challenge-description');
|
||||
await expect(challengeDescription).toHaveText(/ */);
|
||||
|
||||
const link = page.getByRole('link', { name: 'your achievements page' });
|
||||
await expect(link).toHaveAttribute(
|
||||
'href',
|
||||
'https://learn.microsoft.com/users/me/achievements#trophies-section'
|
||||
);
|
||||
await expect(link).toHaveAttribute('target', '_blank');
|
||||
await expect(link).toHaveAttribute('rel', 'noreferrer');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user