feat: create local mobile notes

This commit is contained in:
lucaronin
2026-05-04 19:00:09 +02:00
parent 0efad2211a
commit 5da79cac74
5 changed files with 98 additions and 5 deletions

View File

@@ -0,0 +1,34 @@
import { describe, expect, it } from 'vitest'
import { createMobileNoteFile } from './mobileNoteCreate'
describe('mobile note create', () => {
it('creates a deterministic markdown file from the current time', () => {
const file = createMobileNoteFile({
now: new Date('2026-05-04T12:34:56.000Z'),
})
expect(file).toEqual({
path: 'note-mor6mem8.md',
content: [
'---',
'title: Untitled',
'type: Note',
'created: 2026-05-04T12:34:56.000Z',
'---',
'',
'# Untitled',
'',
].join('\n'),
})
})
it('supports a custom title for future create flows', () => {
const file = createMobileNoteFile({
now: new Date('2026-05-04T12:34:56.000Z'),
title: 'Meeting notes',
})
expect(file.content).toContain('title: Meeting notes')
expect(file.content).toContain('# Meeting notes')
})
})