diff --git a/e2e/debug-screenshot.png b/e2e/debug-screenshot.png new file mode 100644 index 0000000..d6a2e96 Binary files /dev/null and b/e2e/debug-screenshot.png differ diff --git a/e2e/tests/search-clean.spec.ts b/e2e/tests/search-clean.spec.ts index 0055970..50da331 100644 --- a/e2e/tests/search-clean.spec.ts +++ b/e2e/tests/search-clean.spec.ts @@ -3,6 +3,7 @@ import { test, expect } from '@playwright/test'; test.beforeEach(async ({ page }) => { await page.addInitScript(() => { window.__TAURI_INTERNALS__ = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars invoke: async (cmd, args) => { switch (cmd) { case 'check_admin': return true; diff --git a/test-results/.last-run.json b/test-results/.last-run.json new file mode 100644 index 0000000..cbcc1fb --- /dev/null +++ b/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "passed", + "failedTests": [] +} \ No newline at end of file diff --git a/tests/unit/path-manager.test.ts b/tests/unit/path-manager.test.ts index 7ccf946..5cf8cb2 100644 --- a/tests/unit/path-manager.test.ts +++ b/tests/unit/path-manager.test.ts @@ -11,25 +11,25 @@ const validateFn = (path: string) => !path.includes('Invalid'); describe('pathClean', () => { it('移除无效路径', () => { - const [kept, removed] = pathClean([pe('C:\\Valid'), pe('C:\\Invalid'), pe('D:\\Valid')], validateFn as any); + const [kept, removed] = pathClean([pe('C:\\Valid'), pe('C:\\Invalid'), pe('D:\\Valid')], validateFn); expect(kept.map(e => e.path)).toEqual(['C:\\Valid', 'D:\\Valid']); expect(removed.map(e => e.path)).toEqual(['C:\\Invalid']); }); it('移除重复路径保留第一个', () => { - const [kept, removed] = pathClean([pe('C:\\Valid'), pe('C:\\Valid'), pe('D:\\Valid')], alwaysValid as any); + const [kept, removed] = pathClean([pe('C:\\Valid'), pe('C:\\Valid'), pe('D:\\Valid')], alwaysValid); expect(kept.length).toBe(2); expect(removed.length).toBe(1); }); it('全部有效无变化', () => { - const [kept, removed] = pathClean([pe('C:\\a'), pe('D:\\b')], alwaysValid as any); + const [kept, removed] = pathClean([pe('C:\\a'), pe('D:\\b')], alwaysValid); expect(kept.map(e => e.path)).toEqual(['C:\\a', 'D:\\b']); expect(removed.length).toBe(0); }); it('全部无效全部移除', () => { - const [kept, removed] = pathClean([pe('C:\\Invalid1'), pe('C:\\Invalid2')], validateFn as any); + const [kept, removed] = pathClean([pe('C:\\Invalid1'), pe('C:\\Invalid2')], validateFn); expect(kept.length).toBe(0); expect(removed.length).toBe(2); });