openpencil/tests/engine/app/editor/store-path.test.ts
Danila Poyarkov a6940bcab8 feat(app): convert image layers to vectors
- 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>
2026-07-27 16:22:05 +03:00

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')
})
})