openpencil/tests/engine/app/editor-store-path.test.ts
Danila Poyarkov 930cf39216 test: organize prefixed test files into folders
- Move top-level engine and e2e prefixed test files under domain folders
- Update fixture path helpers after moving render and pen tests
- Add lint coverage to prevent new top-level prefixed test files
- Refresh testing docs for the new fig and layout paths
2026-05-06 02:13:18 +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')
})
})