Files
gitea/tests/e2e
silverwind 7492251e7e Fix relative-time RangeError (#37021)
`navigator.language` can be `undefined` in headless browsers (e.g.
Playwright Firefox), causing `RangeError: invalid language tag:
"undefined"` in `Intl.DateTimeFormat` within the `relative-time` web
component.

Also adds an e2e test that verifies `relative-time` renders correctly
and a shared `assertNoJsError` helper.

Bug is als present in https://github.com/github/relative-time-element
but (incorrectly) masked there.

Fixes: https://github.com/go-gitea/gitea/issues/25324

---------

Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-03-28 13:10:51 +00:00
..
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-02-20 16:26:47 -08:00
2026-03-28 13:10:51 +00:00

import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {apiCreateRepo, apiDeleteRepo} from './utils.ts';

test('repo readme', async ({page}) => {
  const repoName = `e2e-readme-${Date.now()}`;
  await apiCreateRepo(page.request, {name: repoName});
  await page.goto(`/${env.GITEA_TEST_E2E_USER}/${repoName}`);
  await expect(page.locator('#readme')).toContainText(repoName);
  await apiDeleteRepo(page.request, env.GITEA_TEST_E2E_USER, repoName);
});