|
1 | 1 | import { test, expect } from '@playwright/test'; |
2 | 2 |
|
3 | 3 | test.describe('Markdown shortcode links', () => { |
4 | | - test('render relref links inside markdown link syntax', async ({ page }) => { |
5 | | - await page.goto('/posts/2026-03-12-java-modules-encapsulation-internal-packages'); |
| 4 | + test('render relref and ref links to post and top-level routes', async ({ page }) => { |
| 5 | + await page.goto('/posts/2026-02-10-review-2025', { |
| 6 | + waitUntil: 'domcontentloaded', |
| 7 | + }); |
| 8 | + await expect(page.locator('main')).toBeVisible(); |
6 | 9 |
|
7 | 10 | const articleBody = page.locator('main .prose').first(); |
8 | 11 | const firstArticleLink = articleBody.locator( |
9 | | - 'a[href="/posts/2026-01-27-java-modules-maven4-basics"]', |
| 12 | + 'a[href="/posts/2025-01-16-open-elements-in-2024"]', |
10 | 13 | ); |
11 | | - const homeworkLink = articleBody.locator( |
12 | | - 'a[href="/posts/2026-02-26-java-modules-maven4-basics-homework"]', |
| 14 | + const supportCareLink = articleBody.locator( |
| 15 | + 'a[href="/support-care-maven"]', |
13 | 16 | ); |
14 | 17 |
|
15 | 18 | await expect(firstArticleLink).toBeVisible(); |
16 | | - await expect(firstArticleLink).toContainText('first article'); |
17 | | - await expect(homeworkLink).toBeVisible(); |
18 | | - await expect(homeworkLink).toContainText('homework extension'); |
| 19 | + await expect(firstArticleLink).toContainText('growth trajectory from 2024'); |
| 20 | + await expect(supportCareLink.first()).toBeVisible(); |
19 | 21 | }); |
20 | 22 |
|
21 | | - test('preserve relref fragments inside markdown links', async ({ page }) => { |
22 | | - await page.goto('/posts/2026-02-26-java-modules-maven4-basics-homework'); |
| 23 | + test('render relref links to nested routes', async ({ page }) => { |
| 24 | + await page.goto('/posts/2026-02-10-review-2025', { |
| 25 | + waitUntil: 'domcontentloaded', |
| 26 | + }); |
| 27 | + await expect(page.locator('main')).toBeVisible(); |
23 | 28 |
|
24 | 29 | const articleBody = page.locator('main .prose').first(); |
25 | | - const fragmentLink = articleBody.locator( |
26 | | - 'a[href="/posts/2026-01-27-java-modules-maven4-basics#the-module-source-hierarchy"]', |
| 30 | + const articleLink = articleBody.locator( |
| 31 | + 'a[href="/articles/what-is-maven"]', |
27 | 32 | ); |
| 33 | + const employeeLink = articleBody.locator('a[href="/employees/jessie"]'); |
28 | 34 |
|
29 | | - await expect(fragmentLink).toBeVisible(); |
30 | | - await expect(fragmentLink).toContainText('module source hierarchy'); |
| 35 | + await expect(articleLink).toBeVisible(); |
| 36 | + await expect(articleLink).toContainText('work on Apache Maven'); |
| 37 | + await expect(employeeLink).toBeVisible(); |
| 38 | + await expect(employeeLink).toContainText('Jessy Ssebuliba'); |
31 | 39 | }); |
32 | 40 | }); |
0 commit comments