mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-15 23:40:58 +02:00
fix(deps): update dependency mermaid to v11.15.0 [security], add e2e test (#37665)
Backport of #37662. --- This PR was written with the help of Claude Opus 4.7 --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
parent
5829522019
commit
57dd9f5bab
@ -54,7 +54,7 @@
|
||||
"jquery": "4.0.0",
|
||||
"js-yaml": "4.1.1",
|
||||
"katex": "0.16.44",
|
||||
"mermaid": "11.14.0",
|
||||
"mermaid": "11.15.0",
|
||||
"online-3d-viewer": "0.18.0",
|
||||
"pdfobject": "2.3.1",
|
||||
"perfect-debounce": "2.1.0",
|
||||
|
||||
851
pnpm-lock.yaml
generated
851
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
22
tests/e2e/mermaid.test.ts
Normal file
22
tests/e2e/mermaid.test.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import {env} from 'node:process';
|
||||
import {expect, test} from '@playwright/test';
|
||||
import {apiCreateRepo, apiHeaders, assertNoJsError, baseUrl, randomString} from './utils.ts';
|
||||
|
||||
test('mermaid diagram in issue', async ({page, request}) => {
|
||||
const repoName = `e2e-mermaid-${randomString(8)}`;
|
||||
const owner = env.GITEA_TEST_E2E_USER;
|
||||
await apiCreateRepo(request, {name: repoName});
|
||||
const body = '```mermaid\nflowchart LR\n Alpha --> Beta\n Beta --> Gamma\n```\n';
|
||||
const response = await request.post(`${baseUrl()}/api/v1/repos/${owner}/${repoName}/issues`, {
|
||||
headers: apiHeaders(),
|
||||
data: {title: 'mermaid test', body},
|
||||
});
|
||||
expect(response.ok(), `create issue failed: ${response.status()}`).toBe(true);
|
||||
const {number} = await response.json();
|
||||
await page.goto(`/${owner}/${repoName}/issues/${number}`);
|
||||
|
||||
const svg = page.frameLocator('iframe.markup-content-iframe').locator('svg');
|
||||
await expect(svg).toContainText(/Alpha[\s\S]*Beta[\s\S]*Gamma/);
|
||||
|
||||
await assertNoJsError(page);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user