feat(export): add .toml source download and shared slugify helper

This commit is contained in:
Julien Calixte
2026-06-17 09:32:07 +02:00
parent 35c84cf943
commit 3c32542a76
3 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
import { describe, it, expect } from 'vitest'
import { sourceFilename } from './useSourceExport'
describe('sourceFilename', () => {
it('slugifies the plan title into a .toml name', () => {
expect(sourceFilename('Q3 — Checkout revamp')).toBe('macroplan-q3-checkout-revamp.toml')
})
it('falls back to a generic name when the title has no usable characters', () => {
expect(sourceFilename('')).toBe('macroplan-plan.toml')
expect(sourceFilename('—— ··')).toBe('macroplan-plan.toml')
})
})