d0b3f21bde
Remove AI-dependent extensions (ai-chat, ai-categorization, receipt-ocr, invoice-inbox) and their infrastructure (lib/ai/*, ai-consent, LangChain/ Anthropic/OpenAI deps) to simplify core and reduce bundle size. Restructure monolithic settings page into dedicated sub-pages (company, bookkeeping, invoicing, tax, banking, api, account, team, templates) with shared layout and sidebar navigation. Add atomic commit_journal_entry RPC so voucher number increment and status update happen in a single transaction — prevents burned numbers on constraint failures. Add continuity check report and voucher gap explanation tracking. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
750 B
TypeScript
22 lines
750 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { makeTransaction } from '@/tests/helpers'
|
|
import { findSimilarTemplates } from '../template-embeddings'
|
|
|
|
describe('template-embeddings facade', () => {
|
|
describe('findSimilarTemplates', () => {
|
|
it('returns keyword-based matches', async () => {
|
|
const tx = makeTransaction({ description: 'SPOTIFY', amount: -109 })
|
|
const results = await findSimilarTemplates(tx)
|
|
|
|
expect(Array.isArray(results)).toBe(true)
|
|
})
|
|
|
|
it('accepts entityType parameter', async () => {
|
|
const tx = makeTransaction({ description: 'SPOTIFY', amount: -109 })
|
|
const results = await findSimilarTemplates(tx, 'enskild_firma')
|
|
|
|
expect(Array.isArray(results)).toBe(true)
|
|
})
|
|
})
|
|
})
|