From e878b379315649109bdd1e96ad2a3d563580c438 Mon Sep 17 00:00:00 2001 From: YunYouJun Date: Thu, 17 Jul 2025 22:51:12 +0800 Subject: [PATCH] e2e: add custom container custom title for danger/details --- e2e/theme-yun/markdown/container.spec.ts | 18 ++++++++++++++++++ e2e/theme-yun/markdown/include.spec.ts | 7 +------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 e2e/theme-yun/markdown/container.spec.ts diff --git a/e2e/theme-yun/markdown/container.spec.ts b/e2e/theme-yun/markdown/container.spec.ts new file mode 100644 index 00000000..93e74ec5 --- /dev/null +++ b/e2e/theme-yun/markdown/container.spec.ts @@ -0,0 +1,18 @@ +import { expect, test } from '@playwright/test' +import { setup } from '../../utils' + +setup('theme-yun') + +test.describe('Markdown: Custom Container', () => { + test('Custom Title', async ({ page }) => { + await page.goto('/test/custom-blocks') + await page.waitForSelector('.custom-block-title') + + const customDangerTitle = await page.locator('.custom-block-title').nth(5).textContent() + expect(customDangerTitle).toContain('自定义标题') + + // 第二个 details summary 为自定义标题 + const customDetailsSummary = await page.locator('details summary').nth(1).textContent() + expect(customDetailsSummary).toContain('自定义标题') + }) +}) diff --git a/e2e/theme-yun/markdown/include.spec.ts b/e2e/theme-yun/markdown/include.spec.ts index 40398562..8f07758b 100644 --- a/e2e/theme-yun/markdown/include.spec.ts +++ b/e2e/theme-yun/markdown/include.spec.ts @@ -1,12 +1,7 @@ import { expect, test } from '@playwright/test' -import { env } from '../../env' import { setup } from '../../utils' -test.use({ - baseURL: env['theme-yun'], -}) - -setup() +setup('theme-yun') test.describe('Markdown File Inclusion by @include', () => { test('test/markdown-file-inclusion', async ({ page }) => {