8000 Refactor repo-projects.ts by silverwind · Pull Request #32892 · go-gitea/gitea · GitHub
[go: up one dir, main page]

Skip to content

Refactor repo-projects.ts #32892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
add type
  • Loading branch information
silverwind committed Dec 18, 2024
commit 123d20c8d86c9f8c5707461a0e0a4cfaf08cbe26
4 changes: 2 additions & 2 deletions web_src/js/features/repo-settings-branches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {beforeEach, describe, expect, test, vi} from 'vitest';
import {initRepoSettingsBranchesDrag} from './repo-settings-branches.ts';
import {POST} from '../modules/fetch.ts';
import {createSortable} from '../modules/sortable.ts';
import type {SortableEvent} from 'sortablejs';
import type {SortableEvent, SortableOptions} from 'sortablejs';
import type Sortable from 'sortablejs';

vi.mock('../modules/fetch.ts', () => ({
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('Repository Branch Settings', () => {
vi.mocked(POST).mockResolvedValue({ok: true} as Response);

// Mock createSortable to capture and execute the onEnd callback
vi.mocked(createSortable).mockImplementation(async (_el: Element, options) => {
vi.mocked(createSortable).mockImplementation(async (_el: Element, options: SortableOptions) => {
options.onEnd(new Event('SortableEvent') as SortableEvent);
// @ts-expect-error: mock is incomplete
return {destroy: vi.fn()} as Sortable;
Expand Down
Loading
0