import { describe, expect, test } from 'bun:test'
import { cleanSessionTitleSource } from '../sessionTitleText.js'
describe('sessionTitleText', () => {
test('converts slash command XML metadata into a user-facing title source', () => {
const raw = [
'frontend-design',
'/frontend-design',
'@website 重新设计首页',
].join('\n')
expect(cleanSessionTitleSource(raw)).toBe('/frontend-design @website 重新设计首页')
})
test('strips non-command internal XML wrappers from title sources', () => {
expect(cleanSessionTitleSource('secret.ts\nFix login'))
.toBe('Fix login')
})
})