mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-01 05:12:13 +00:00
`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>
11 lines
423 B
TypeScript
11 lines
423 B
TypeScript
import {test, expect} from '@playwright/test';
|
|
import {assertNoJsError} from './utils.ts';
|
|
|
|
test('relative-time renders without errors', async ({page}) => {
|
|
await page.goto('/devtest/relative-time');
|
|
const relativeTime = page.getByTestId('relative-time-now');
|
|
await expect(relativeTime).toHaveAttribute('data-tooltip-content', /.+/);
|
|
await expect(relativeTime).toHaveText('now');
|
|
await assertNoJsError(page);
|
|
});
|