Files
deepseek-harness/packages/host/directory-picker-native/tests/service.spec.ts
T
creatixchu 5579b13503 refactor(host): rename the directory-picker dialog backend and kind to native
The browse interaction also presents a dialog (the in-app modal), so 'dialog'
failed to discriminate the two capability kinds; 'native' names where the
chooser runs. Package directory-picker-dialog -> directory-picker-native, kind
'dialog' -> 'native', with every seam/gateway/client/doc reference updated and
the seam Agent Note's naming rationale rewritten to match.
2026-07-28 21:07:28 +08:00

22 lines
884 B
TypeScript

/** Registration/capability behavior of the native backend (the seam's cordis half). */
import { describe, expect, it } from 'vitest'
import { Context } from 'cordis'
import NativeDirectoryPicker from '../src/index.ts'
describe('NativeDirectoryPicker', () => {
it('registers ctx.directoryPicker with a stable native capability and leaves with its fiber', async () => {
const ctx = new Context()
const fiber = ctx.plugin(NativeDirectoryPicker)
await fiber.await()
const picker = ctx.get('directoryPicker')
expect(picker).toBeInstanceOf(NativeDirectoryPicker)
const capability = picker!.capability()
expect(capability.kind).toBe('native')
// Stability: consumers may capture the capability object across calls.
expect(picker!.capability()).toBe(capability)
await fiber.dispose()
expect(ctx.get('directoryPicker')).toBeUndefined()
})
})