refactor(storageCleaner): simplify architecture and improve type semantics
- Remove RELOAD_TAB message chain, use chrome.tabs.reload() directly - Rename IndexedDB label to '站点存储' for accuracy - Introduce StorageSizeInfo type to distinguish bytes vs count - Rename totalSize to totalBytes for clarity - Merge runCleanScript into runScript to reduce duplication - Rename CleaningResult.success to overallSuccess to avoid confusion - Remove unused domain state and setDomain call Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1
-2
@@ -125,7 +125,7 @@ const webExtensionMock = {
|
||||
get: vi.fn().mockResolvedValue({}),
|
||||
sendMessage: vi.fn().mockResolvedValue(undefined),
|
||||
create: vi.fn().mockResolvedValue({}),
|
||||
reload: vi.fn().mockResolvedValue(undefined), // ✅ 承接 MessageAction.RELOAD_TAB 刷新单元测试
|
||||
reload: vi.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
runtime: {
|
||||
id: 'test-extension-id',
|
||||
@@ -202,7 +202,6 @@ afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
// 全局 matchMedia 极客级环境模拟(ThemeModeProvider 依赖)
|
||||
beforeEach(() => {
|
||||
Object.defineProperty(window, 'matchMedia', {
|
||||
writable: true,
|
||||
|
||||
Reference in New Issue
Block a user