mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-28 21:30:44 +01:00
Backport #39973 by @Hello-Liar The file view, blame and web editor read `.editorconfig` from the default branch, so branch-specific settings like tab width were ignored. The file view's middleware ran before the ref was resolved, and blame never loaded it. - `GetEditorconfig` reads the current commit, falling back to the default branch only where no ref is resolved - `Home` and `RefBlame` load the editorconfig after ref resolution Fixes: https://github.com/go-gitea/gitea/issues/27413 Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Hello-Liar <80651389+Hello-Liar@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
20 lines
835 B
TypeScript
20 lines
835 B
TypeScript
import {env} from 'node:process';
|
|
import {expect, test} from '@playwright/test';
|
|
import {login, apiCreateFiles, apiCreateRepo, randomString} from './utils.ts';
|
|
|
|
test('codeeditor textarea updates correctly', async ({page, request}) => {
|
|
const repoName = `e2e-codeeditor-${randomString(8)}`;
|
|
const owner = env.GITEA_TEST_E2E_USER;
|
|
await Promise.all([
|
|
(async () => {
|
|
await apiCreateRepo(request, {name: repoName});
|
|
await apiCreateFiles(request, owner, repoName, [{path: '.editorconfig', content: '[*]\nindent_size = 2\n'}], {newBranch: 'feature'});
|
|
})(),
|
|
login(page),
|
|
]);
|
|
await page.goto(`/${owner}/${repoName}/_new/feature`);
|
|
await page.locator('.cm-content[role="textbox"]').click();
|
|
await page.keyboard.press('Tab');
|
|
await expect(page.locator('textarea[name="content"]')).toHaveValue(' ');
|
|
});
|