From 05a9efe30992a0c01e4303d28114e08d0b9ca21f Mon Sep 17 00:00:00 2001 From: dvcolomban Date: Sat, 5 Sep 2026 16:03:26 +0200 Subject: [PATCH] test(hub-ui): cover collapsed edge logo positions --- .../components/dock/DockEdge.stories.ts | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts b/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts index ba3775af8..2fd1f8751 100644 --- a/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts +++ b/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts @@ -72,27 +72,37 @@ export const Right: Story = edgeStory('right') /** Toolbar only, nothing selected, so the panel body is collapsed away. */ export const ToolbarOnly: Story = edgeStory('bottom', false) +function collapsedEdgeStory(position: 'top' | 'right' | 'bottom' | 'left'): Story { + return { + render: () => ({ + setup: () => mountWithContext( + { + entries: categorizedEntries, + selectedId: null, + panel: { mode: 'edge', position, inactiveTimeout: 0 }, + session: { open: false }, + }, + ctx => [ + h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }), + h(FloatingElements), + ], + ), + }), + } +} + /** * Idle-collapsed: the default `autoCollapseEdgeToolbar` with `inactiveTimeout: * 0` (the same trick `Dock.stories.ts`'s own `Minimized` story uses) shrinks * the toolbar down to a small corner pill immediately, with nothing selected. */ -export const CollapsedIdle: Story = { - render: () => ({ - setup: () => mountWithContext( - { - entries: categorizedEntries, - selectedId: null, - panel: { mode: 'edge', position: 'bottom', inactiveTimeout: 0 }, - session: { open: false }, - }, - ctx => [ - h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }), - h(FloatingElements), - ], - ), - }), -} +export const CollapsedIdle: Story = collapsedEdgeStory('bottom') + +/** Left edge collapsed to its idle logo pill. */ +export const CollapsedLeft: Story = collapsedEdgeStory('left') + +/** Right edge collapsed to its idle logo pill. */ +export const CollapsedRight: Story = collapsedEdgeStory('right') const settingsEntry: DevframeViewBuiltin = { type: '~builtin',