Merge remote-tracking branch 'origin/feat/directory-picker' into feat/workspace-directory-browser
This commit is contained in:
@@ -83,6 +83,11 @@ describe('directory-picker-native client half', () => {
|
|||||||
const second = owner()
|
const second = owner()
|
||||||
view.rerender(<NativeDirectoryFlow {...second} busy pick={pick} />)
|
view.rerender(<NativeDirectoryFlow {...second} busy pick={pick} />)
|
||||||
expect(pick).toHaveBeenCalledOnce()
|
expect(pick).toHaveBeenCalledOnce()
|
||||||
|
// Even a fresh injected face (re-registration re-runs the inject factory)
|
||||||
|
// must not relaunch while the same request is still open.
|
||||||
|
const replacedPick = vi.fn(() => new Promise<string | null>(() => {}))
|
||||||
|
view.rerender(<NativeDirectoryFlow {...second} busy pick={replacedPick} />)
|
||||||
|
expect(replacedPick).not.toHaveBeenCalled()
|
||||||
await act(async () => { resolve('/tmp/project') })
|
await act(async () => { resolve('/tmp/project') })
|
||||||
expect(second.onPicked).toHaveBeenCalledWith('/tmp/project')
|
expect(second.onPicked).toHaveBeenCalledWith('/tmp/project')
|
||||||
expect(first.onPicked).not.toHaveBeenCalled()
|
expect(first.onPicked).not.toHaveBeenCalled()
|
||||||
|
|||||||
Reference in New Issue
Block a user