d4122c8f95
Add pomodoro timer with goal notifications, writing streak milestones, and knowledge injection logging with UI previews across AI writing flows. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
1000 B
TypeScript
28 lines
1000 B
TypeScript
import { describe, it, expect, afterEach } from 'vitest'
|
|
import { DatabaseSync } from 'node:sqlite'
|
|
import { migrate } from '../../src/main/db/migrate'
|
|
import type { SqliteDb } from '../../src/main/db/types'
|
|
|
|
describe('migrate v8', () => {
|
|
let db: SqliteDb
|
|
afterEach(() => db?.close())
|
|
|
|
it('UT-MIG-08: v7 database migrates to v8 with injection table', () => {
|
|
db = new DatabaseSync(':memory:')
|
|
migrate(db)
|
|
const version = db.prepare('SELECT MAX(version) AS v FROM schema_version').get() as { v: number }
|
|
expect(version.v).toBe(8)
|
|
const table = db
|
|
.prepare(
|
|
"SELECT name FROM sqlite_master WHERE type='table' AND name='knowledge_injection_logs'"
|
|
)
|
|
.get()
|
|
expect(table).toBeTruthy()
|
|
const cols = db.prepare('PRAGMA table_info(knowledge_injection_logs)').all() as Array<{
|
|
name: string
|
|
}>
|
|
expect(cols.some((c) => c.name === 'knowledge_entry_id')).toBe(true)
|
|
expect(cols.some((c) => c.name === 'flow_mode')).toBe(true)
|
|
})
|
|
})
|