diff options
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/__tests__/downloadFile.test.ts | 6 | ||||
| -rw-r--r-- | webAO/__tests__/isAudio.test.ts | 3 | ||||
| -rw-r--r-- | webAO/dom/window.ts | 12 |
3 files changed, 10 insertions, 11 deletions
diff --git a/webAO/__tests__/downloadFile.test.ts b/webAO/__tests__/downloadFile.test.ts index 738d6f3..67c2c46 100644 --- a/webAO/__tests__/downloadFile.test.ts +++ b/webAO/__tests__/downloadFile.test.ts @@ -2,7 +2,7 @@ import downloadFile from "../services/downloadFile"; jest.useFakeTimers().setSystemTime(new Date("2020-01-01").getTime()); global.URL.createObjectURL = jest.fn(); -(window as any).global.Blob = function (content, options) { +(window as any).global.Blob = function (content: any, options: any) { return { content, options }; }; @@ -10,7 +10,7 @@ describe("downloadFile", () => { it("Creates an <a> tag", () => { const createElementSpy = jest.spyOn(document, "createElement"); downloadFile("hi", "filename"); - expect(createElementSpy).toBeCalled(); + expect(createElementSpy).toHaveBeenCalled(); }); it("Creates the blob with the correct data", () => { const data = "writingtestsishard"; @@ -22,6 +22,6 @@ describe("downloadFile", () => { type: "text", }, }; - expect(global.URL.createObjectURL).toBeCalledWith(expected); + expect(global.URL.createObjectURL).toHaveBeenCalledWith(expected); }); }); diff --git a/webAO/__tests__/isAudio.test.ts b/webAO/__tests__/isAudio.test.ts index 327a0de..f5b84ef 100644 --- a/webAO/__tests__/isAudio.test.ts +++ b/webAO/__tests__/isAudio.test.ts @@ -19,11 +19,10 @@ describe('isAudio', () => { expect(isAudio('')).toBe(false); // Empty string expect(isAudio(undefined)).toBe(false); // Undefined input expect(isAudio(null)).toBe(false); // Null input - expect(isAudio({})).toBe(false); // Invalid type (object) }); test('should return true for files with multiple valid extensions', () => { expect(isAudio('file.wav.mp3')).toBe(true); expect(isAudio('track.ogg.opus')).toBe(true); }); -});
\ No newline at end of file +}); diff --git a/webAO/dom/window.ts b/webAO/dom/window.ts index ba19982..ac43a0a 100644 --- a/webAO/dom/window.ts +++ b/webAO/dom/window.ts @@ -25,7 +25,7 @@ declare global { deleteEvidence: () => void; editEvidence: () => void; addEvidence: () => void; - pickEvidence: (evidence: any) => void; + pickEvidence: (evidence: number) => void; pickEmotion: (emo: number) => void; pickChar: (ccharacter: any) => void; chartable_filter: (_event: any) => void; @@ -37,21 +37,21 @@ declare global { changeCharacter: (_event: any) => void; switchChatOffset: () => void; switchAspectRatio: () => void; - switchPanTilt: (addcheck: number) => void; + switchPanTilt: () => Promise<void>; iniedit: () => void; modcall_test: () => void; reloadTheme: () => void; changeCallwords: () => void; changeBlipVolume: () => void; - changeMusicVolume: () => void; - area_click: (el: any) => void; - showname_click: (_event: any) => void; + changeMusicVolume: (volume?: number) => void; + area_click: (el: HTMLElement) => void; + showname_click: (_event: Event | null) => void; mutelist_click: (_event: any) => void; musiclist_click: (_event: any) => void; musiclist_filter: (_event: any) => void; resetOffset: (_event: any) => void; onEnter: (event: any) => void; - onReplayGo: (_event: any) => void; + onReplayGo: (_event: Event) => void; onOOCEnter: (_event: any) => void; kickPlayer: (id: number) => void; banPlayer: (id: number) => void; |
