Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3320,7 +3320,7 @@ async function bootstrap(): Promise<void> {

const result = await dialog.showOpenDialog(mainWindow, {
title: harnessLocale() === 'zh' ? '选择工作区目录' : 'Select Workspace Directory',
properties: ['openDirectory']
properties: ['openDirectory', 'createDirectory']
})
return result.canceled ? null : result.filePaths[0] ?? null
})
Expand Down
8 changes: 8 additions & 0 deletions test/directory-picker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ describe('desktop Electron directory picker', () => {
expect(controller).toContain('static inject = ["directoryPicker"]')
expect(controller).toContain('"directoryPickerController"')
})

it('lets the workspace directory dialog create a folder on macOS', async () => {
const main = await readFile('src/main/index.ts', 'utf8')
const handlerStart = main.indexOf("ipcMain.handle('directory-picker:open'")
const handler = main.slice(handlerStart, main.indexOf('ipcMain.handle(', handlerStart + 1))

expect(handler).toContain("properties: ['openDirectory', 'createDirectory']")
})
})
2 changes: 1 addition & 1 deletion test/signed-test-build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ with tempfile.TemporaryDirectory() as work:
assert [e[0] for e in events] == ['upload', 'verify', 'notify']
assert events[0][1] == 'test/1.0.0-test.1/42/dsh-desktop-windows-x64-setup.exe'
assert events[2][1] == {'test_build': True}
assert 'Windows x64' in (directory / 'summary').read_text()
assert 'Windows x64' in (directory / 'summary').read_text(encoding='utf-8')
notify.reset_mock()
api.upload_file.side_effect = RuntimeError('upload failed')
try:
Expand Down
Loading