- Add secure Recraft and fal.ai clients with centralized credentials and Media settings - Replace image rectangles with editable vector frames in one undoable operation - Bound desktop proxy responses, timeouts, and redirects for provider downloads - Cover provider parsing, placement, settings, context-menu visibility, and undo Co-authored-by: Rob Coenen <753704+rcoenen@users.noreply.github.com>
24 lines
756 B
TypeScript
24 lines
756 B
TypeScript
import { describe, test, expect } from 'bun:test'
|
|
|
|
import { createEditorStore } from '@/app/editor/session'
|
|
|
|
describe('setPlannedFilePath', () => {
|
|
test('sets document name from file path', () => {
|
|
const store = createEditorStore()
|
|
store.setPlannedFilePath('/tmp/projects/my-design.fig')
|
|
expect(store.state.documentName).toBe('my-design')
|
|
})
|
|
|
|
test('handles Windows-style paths', () => {
|
|
const store = createEditorStore()
|
|
store.setPlannedFilePath('C:\\Users\\test\\design.fig')
|
|
expect(store.state.documentName).toBe('design')
|
|
})
|
|
|
|
test('handles path without extension', () => {
|
|
const store = createEditorStore()
|
|
store.setPlannedFilePath('/tmp/Untitled')
|
|
expect(store.state.documentName).toBe('Untitled')
|
|
})
|
|
})
|