mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
- Add TitleGenerator module to generate session titles using Agent CLI - Support claude-code, opencode, and codex agents - Fire-and-forget async generation on first user message - Prevent concurrent generation with in-flight tracking - Re-check before update to avoid overwriting manual titles - Add double-click to edit session title in sidebar - Inline editing with Enter to save, Escape to cancel - Blur saves by default, but respects Escape cancellation - Persist title changes to database - Add SESSION_UPDATE IPC channel for title updates - Add SESSION_META_UPDATED event for real-time UI sync - Add comprehensive unit tests for new functionality Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
21 lines
583 B
TypeScript
21 lines
583 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { isValidPath } from '../../../../src/main/utils/pathValidation'
|
|
|
|
describe('isValidPath', () => {
|
|
it('accepts absolute POSIX paths', () => {
|
|
expect(isValidPath('/tmp/project')).toBe(true)
|
|
})
|
|
|
|
it('accepts absolute POSIX paths with trailing slash', () => {
|
|
expect(isValidPath('/tmp/project/')).toBe(true)
|
|
})
|
|
|
|
it('rejects relative paths', () => {
|
|
expect(isValidPath('tmp/project')).toBe(false)
|
|
})
|
|
|
|
it('rejects POSIX traversal segments', () => {
|
|
expect(isValidPath('/tmp/../secret')).toBe(false)
|
|
})
|
|
})
|