hermes-agent/apps/desktop/electron/select-paths-dialog.test.ts
brooklyn! 771b42e2ef fix(desktop): let the project folder picker create a new folder
The native directory picker now passes createDirectory, so macOS shows
New Folder. The remote folder picker gets a New folder action that calls
the existing POST /api/files/mkdir under the current path and opens the
new folder, ready to select.
2026-09-24 02:27:45 -05:00

26 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { selectPathsDialogProperties } from './select-paths-dialog'
describe('selectPathsDialogProperties', () => {
it('lets a directory picker create a new folder (macOS hides New Folder without createDirectory)', () => {
const properties = selectPathsDialogProperties({ directories: true, multiple: false })
expect(properties).toContain('openDirectory')
expect(properties).toContain('createDirectory')
})
it('keeps file pickers file-only and multi-select by default', () => {
const properties = selectPathsDialogProperties({})
expect(properties).toContain('openFile')
expect(properties).toContain('multiSelections')
expect(properties).not.toContain('openDirectory')
expect(properties).not.toContain('createDirectory')
})
it('drops multi-select only when the caller opts out', () => {
expect(selectPathsDialogProperties({ directories: true })).toContain('multiSelections')
expect(selectPathsDialogProperties({ directories: true, multiple: false })).not.toContain('multiSelections')
})
})