mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 20:45:37 +02:00
- Add collapsible root folder row at top of file tree - Display current folder name in panel header - Add right-click context menu support for root folder - Add Zed editor support in context menu (if installed) - Extract path utilities to shared module Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
778 B
TypeScript
25 lines
778 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { getBaseName } from '../../../../src/renderer/src/utils/path'
|
|
|
|
describe('getBaseName', () => {
|
|
it('returns the last segment for POSIX paths', () => {
|
|
expect(getBaseName('/Users/me/project')).toBe('project')
|
|
})
|
|
|
|
it('handles POSIX paths with trailing slashes', () => {
|
|
expect(getBaseName('/Users/me/project/')).toBe('project')
|
|
})
|
|
|
|
it('returns the last segment for Windows paths', () => {
|
|
expect(getBaseName('C:\\\\Users\\\\me\\\\project')).toBe('project')
|
|
})
|
|
|
|
it('handles Windows paths with trailing slashes', () => {
|
|
expect(getBaseName('C:\\\\Users\\\\me\\\\project\\\\')).toBe('project')
|
|
})
|
|
|
|
it('returns a fallback for root paths', () => {
|
|
expect(getBaseName('/')).toBe('Root')
|
|
})
|
|
})
|