fix: suppress watcher refresh after new note writes

This commit is contained in:
lucaronin
2026-04-29 20:32:08 +02:00
parent 2e8286d2b3
commit d1ed826714
8 changed files with 82 additions and 59 deletions

View File

@@ -380,6 +380,7 @@ describe('useNoteActions hook', () => {
expect(addPendingSave).toHaveBeenCalledWith(createdPath)
expect(removePendingSave).toHaveBeenCalledWith(createdPath)
expect(onNewNotePersisted).toHaveBeenCalledOnce()
expect(onNewNotePersisted).toHaveBeenCalledWith(createdPath)
expect(addEntry).toHaveBeenCalledTimes(1)
expect(result.current.tabs[0].entry.path).toMatch(/untitled-note-\d+\.md$/)
})
@@ -397,6 +398,7 @@ describe('useNoteActions hook', () => {
})
expect(onNewNotePersisted).toHaveBeenCalledTimes(1)
expect(onNewNotePersisted).toHaveBeenCalledWith(expect.stringContaining('persist-callback.md'))
})
it('does not call onNewNotePersisted when disk write fails (Tauri)', async () => {