ADD - notes app

This commit is contained in:
Eichenholz
2026-08-04 11:41:56 +02:00
parent dfc358f85a
commit 8090dbd5ab
11 changed files with 482 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
import { describe, expect, it } from 'vitest'
import { parseNotes } from './notes'
describe('notes persistence', () => {
it('returns valid notes and ignores malformed entries', () => {
const valid = {
body: 'Meet at Mission Row.',
createdAt: 10,
id: 'note-1',
pinned: true,
title: 'Shift briefing',
updatedAt: 20,
}
expect(parseNotes(JSON.stringify([valid, { id: 'broken' }]))).toEqual([
valid,
])
})
it('recovers from missing or invalid storage', () => {
expect(parseNotes(null)).toEqual([])
expect(parseNotes('{invalid')).toEqual([])
expect(parseNotes('{}')).toEqual([])
})
})