test: provide the file action slot runtime in delivery fixtures
This commit is contained in:
1 parent
b80722812b
commit
59fdc2604d
2 files changed
+8
-3
No files matched your search
@@ -42,6 +42,7 @@ function openProps(controller = new PresentedOpenController(), summaries = new C
|
||||
controller.host.set({ name: 'desktop', available: true, fileManager: 'finder' })
|
||||
const sessions: SessionListState = { ids: [], byId: {}, phase: 'ready', projectionsBySession: {}, jobsBySession: {} }
|
||||
return {
|
||||
SessionProvider: ({ children }: { children?: import('react').ReactNode }) => <>{children}</>,
|
||||
renderSlot: renderFileActions,
|
||||
useShowCodeDiff: <T,>(select: (value: boolean) => T): T => select(true),
|
||||
useSessions: <T,>(select: (state: SessionListState) => T): T => select(sessions),
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
/** Capture delivery action ownership without duplicating the opening-control implementation. */
|
||||
import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type { SlotMap } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type {} from '../src/client/index.ts'
|
||||
|
||||
/** Slot renderer exposing the owning route and gesture for component tests. */
|
||||
export const renderFileActions: PropsRenderSlots<'deliverables.file.actions' | 'deliverables.review.file.actions'>['renderSlot'] = (_name, props) =>
|
||||
props.available ? <button type="button" data-action-url={props.actionUrl} disabled={props.pending}
|
||||
export function renderFileActions(
|
||||
_name: 'deliverables.file.actions' | 'deliverables.review.file.actions',
|
||||
props: SlotMap['deliverables.file.actions']['owner'],
|
||||
) {
|
||||
return props.available ? <button type="button" data-action-url={props.actionUrl} disabled={props.pending}
|
||||
onClick={() => { void props.onAction('open') }}>Native file action</button> : null
|
||||
}
|
||||
Reference in new issue
Block a user