feat: 缺失文件扫描支持清理并发布 v2.1.1
构建与发布 / 发布 GitHub Release (push) Blocked by required conditions
构建与发布 / 打包 ${{ matrix.platform }} ${{ matrix.arch }} (arm64, linux, ubuntu-24.04-arm) (push) Blocked by required conditions
构建与发布 / 打包 ${{ matrix.platform }} ${{ matrix.arch }} (x64, linux, ubuntu-24.04) (push) Blocked by required conditions
构建与发布 / 打包 ${{ matrix.platform }} ${{ matrix.arch }} (x64, windows, windows-2025) (push) Blocked by required conditions
构建与发布 / 单测与集成测试 (push) Waiting to run
构建与发布 / 打包 ${{ matrix.platform }} ${{ matrix.arch }} (arm64, macos, macos-15) (push) Blocked by required conditions

This commit is contained in:
lofyer
2026-08-06 17:57:45 +08:00
parent c5b9072ffd
commit eaf9939436
13 changed files with 217 additions and 9 deletions
+11
View File
@@ -645,6 +645,17 @@ test('书库多选提供全选、批量整理与批量移除', () => {
assert.match(library, /window\.api\.library\.updateMany\(patches\)/);
});
test('重新扫描发现文件缺失后提示清理书库条目', () => {
const library = fs.readFileSync(libFile, 'utf8');
const preload = fs.readFileSync(path.join(__dirname, '..', '..', 'preload.js'), 'utf8');
assert.match(library, /const missing = Math\.max\(0, Number\(\(r\.data \|\| \{\}\)\.missing\)/);
assert.match(library, /confirmModal\(\s*'发现文件缺失'/);
assert.match(library, /对应分类和标签也会一并清理/);
assert.match(library, /笔记、书签、进度和标注会保留/);
assert.match(library, /window\.api\.library\.removeMissing\(\)/);
assert.match(preload, /removeMissing: \(\) => ipcRenderer\.invoke\('library:removeMissing'\)/);
});
test('卡片定位上下文不随多选状态消失', () => {
const css = fs.readFileSync(path.join(__dirname, '..', 'ui', 'style.css'), 'utf8');
// 退出多选是同步移除 class,重绘要等 IPC;若定位上下文只在 select-mode 下建立,