Skip to content

Commit

Permalink
rename a repo init function by the way
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Nov 27, 2024
1 parent 4fc5a8d commit 0da8e52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions web_src/js/features/repo-settings-branches.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {beforeEach, describe, expect, test, vi} from 'vitest';
import {initRepoBranchesSettings} from './repo-settings-branches.ts';
import {initRepoSettingsBranches} from './repo-settings-branches.ts';
import {POST} from '../modules/fetch.ts';
import {createSortable} from '../modules/sortable.ts';

Expand Down Expand Up @@ -31,7 +31,7 @@ describe('Repository Branch Settings', () => {
});

test('should initialize sortable for protected branches list', () => {
initRepoBranchesSettings();
initRepoSettingsBranches();

expect(createSortable).toHaveBeenCalledWith(
document.querySelector('#protected-branches-list'),
Expand All @@ -45,7 +45,7 @@ describe('Repository Branch Settings', () => {
test('should not initialize if protected branches list is not present', () => {
document.body.innerHTML = '';

initRepoBranchesSettings();
initRepoSettingsBranches();

expect(createSortable).not.toHaveBeenCalled();
});
Expand All @@ -59,7 +59,7 @@ describe('Repository Branch Settings', () => {
return {destroy: vi.fn()};
});

initRepoBranchesSettings();
initRepoSettingsBranches();

expect(POST).toHaveBeenCalledWith(
'some/repo/branches/priority',
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-settings-branches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
import {queryElemChildren} from '../utils/dom.ts';

export function initRepoBranchesSettings() {
export function initRepoSettingsBranches() {
const protectedBranchesList = document.querySelector('#protected-branches-list');
if (!protectedBranchesList) return;

Expand Down
4 changes: 2 additions & 2 deletions web_src/js/features/repo-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {minimatch} from 'minimatch';
import {createMonaco} from './codeeditor.ts';
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {initRepoBranchesSettings} from './repo-settings-branches.ts';
import {initRepoSettingsBranches} from './repo-settings-branches.ts';

const {appSubUrl, csrfToken} = window.config;

Expand Down Expand Up @@ -155,5 +155,5 @@ export function initRepoSettings() {
initRepoSettingsCollaboration();
initRepoSettingsSearchTeamBox();
initRepoSettingsGitHook();
initRepoBranchesSettings();
initRepoSettingsBranches();
}

0 comments on commit 0da8e52

Please sign in to comment.