fix: stop seeding title during property init

This commit is contained in:
lucaronin
2026-04-19 18:18:35 +02:00
parent 098dc421cb
commit b98d41212e
3 changed files with 34 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
import { describe, expect, it, vi } from 'vitest'
import { initializeNoteProperties } from './initializeNoteProperties'
describe('initializeNoteProperties', () => {
it('seeds only the Note type without creating a title field', async () => {
const updateFrontmatter = vi.fn().mockResolvedValue(undefined)
await initializeNoteProperties(updateFrontmatter, '/vault/plain-note.md')
expect(updateFrontmatter).toHaveBeenCalledTimes(1)
expect(updateFrontmatter).toHaveBeenCalledWith(
'/vault/plain-note.md',
'type',
'Note',
{ silent: true },
)
})
})