test(trash): ExportService excludes trashed notes (regression guard, #4 v0.2.3)

This commit is contained in:
altair823
2026-05-01 21:28:12 +09:00
parent 6f0d032ff1
commit cdceb609e6

View File

@@ -138,4 +138,18 @@ describe('ExportService', () => {
expect(readme).toContain('RAG');
expect(readme).toContain('inkling_export_version');
});
it('does NOT export trashed notes (listAll filter — v0.2.3 #4 회귀 가드)', async () => {
const a = repo.create({ rawText: 'active note' }).id;
const t = repo.create({ rawText: 'trashed note' }).id;
repo.updateAiResult(a, { title: '활성', summary: 'a\nb\nc', tags: [], provider: 'p', dueDate: null });
repo.updateAiResult(t, { title: '버려짐', summary: 'a\nb\nc', tags: [], provider: 'p', dueDate: null });
repo.trash(t, '2026-05-01T00:00:00.000Z');
const r = await svc.export(outDir, { includeMedia: false });
expect(r.noteCount).toBe(1);
// index.jsonl 도 trash 미포함
const indexPath = join(outDir, 'index.jsonl');
const lines = readFileSync(indexPath, 'utf8').trim().split('\n');
expect(lines).toHaveLength(1);
});
});