mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
Allow cropping an avatar before setting it (#32565)
Provide a cropping tool on the avatar editing page, allowing users to select the cropping area themselves. This way, users can decide the displayed area of the image, rather than us deciding for them. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import {beforeEach, describe, expect, test, vi} from 'vitest';
|
||||
import {initRepoBranchesSettings} from './repo-settings-branches.ts';
|
||||
import {initRepoSettingsBranchesDrag} from './repo-settings-branches.ts';
|
||||
import {POST} from '../modules/fetch.ts';
|
||||
import {createSortable} from '../modules/sortable.ts';
|
||||
|
||||
@ -31,7 +31,7 @@ describe('Repository Branch Settings', () => {
|
||||
});
|
||||
|
||||
test('should initialize sortable for protected branches list', () => {
|
||||
initRepoBranchesSettings();
|
||||
initRepoSettingsBranchesDrag();
|
||||
|
||||
expect(createSortable).toHaveBeenCalledWith(
|
||||
document.querySelector('#protected-branches-list'),
|
||||
@ -45,7 +45,7 @@ describe('Repository Branch Settings', () => {
|
||||
test('should not initialize if protected branches list is not present', () => {
|
||||
document.body.innerHTML = '';
|
||||
|
||||
initRepoBranchesSettings();
|
||||
initRepoSettingsBranchesDrag();
|
||||
|
||||
expect(createSortable).not.toHaveBeenCalled();
|
||||
});
|
||||
@ -59,7 +59,7 @@ describe('Repository Branch Settings', () => {
|
||||
return {destroy: vi.fn()};
|
||||
});
|
||||
|
||||
initRepoBranchesSettings();
|
||||
initRepoSettingsBranchesDrag();
|
||||
|
||||
expect(POST).toHaveBeenCalledWith(
|
||||
'some/repo/branches/priority',
|
||||
|
Reference in New Issue
Block a user