From cdceb609e6b54048b8c96d556fc3a0fc6da755af Mon Sep 17 00:00:00 2001 From: altair823 Date: Fri, 1 May 2026 21:28:12 +0900 Subject: [PATCH] test(trash): ExportService excludes trashed notes (regression guard, #4 v0.2.3) --- tests/unit/ExportService.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit/ExportService.test.ts b/tests/unit/ExportService.test.ts index 871a42a..8f6e768 100644 --- a/tests/unit/ExportService.test.ts +++ b/tests/unit/ExportService.test.ts @@ -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); + }); });