mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-01 00:38:10 +00:00
Backport https://github.com/go-gitea/gitea/pull/40046 Mermaid scales diagrams wider than the markup column down to its width, but the iframe kept the unscaled viewBox height, leaving a large blank area below them. The iframe now uses a CSS `aspect-ratio` capped at the viewBox height. Diagrams that don't scale (`useMaxWidth: false`) keep the fixed height. The cherry-pick conflicted only on the `srcdoc` line, which uses an `html` template on `main` but a plain string on `release/v28`. Fixes: https://github.com/go-gitea/gitea/issues/40045
import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {apiCreateRepo, randomString} from './utils.ts';
test('repo readme', async ({page}) => {
const repoName = `e2e-readme-${randomString(8)}`;
await apiCreateRepo(page.request, {name: repoName});
await page.goto(`/${env.GITEA_TEST_E2E_USER}/${repoName}`);
await expect(page.locator('#readme')).toContainText(repoName);
});