mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
Fix remaining typescript issues, enable tsc
(#32840)
Fixes 79 typescript errors. Discovered at least two bugs in `notifications.ts`, and I'm pretty sure this feature was at least partially broken and may still be, I don't really know how to test it. After this, only like ~10 typescript errors remain in the codebase but those are harder to solve. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -2,6 +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';
|
||||
|
||||
vi.mock('../modules/fetch.ts', () => ({
|
||||
POST: vi.fn(),
|
||||
@ -54,8 +55,8 @@ 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((_el, options) => {
|
||||
options.onEnd();
|
||||
vi.mocked(createSortable).mockImplementation(async (_el: Element, options) => {
|
||||
options.onEnd(new Event('SortableEvent') as SortableEvent);
|
||||
return {destroy: vi.fn()};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user