Skip to content

Commit 05a9efe

Browse files
committed
test(hub-ui): cover collapsed edge logo positions
1 parent 6ba7c59 commit 05a9efe

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

packages/hub-ui/src/client/components/dock/DockEdge.stories.ts

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,37 @@ export const Right: Story = edgeStory('right')
7272
/** Toolbar only, nothing selected, so the panel body is collapsed away. */
7373
export const ToolbarOnly: Story = edgeStory('bottom', false)
7474

75+
function collapsedEdgeStory(position: 'top' | 'right' | 'bottom' | 'left'): Story {
76+
return {
77+
render: () => ({
78+
setup: () => mountWithContext(
79+
{
80+
entries: categorizedEntries,
81+
selectedId: null,
82+
panel: { mode: 'edge', position, inactiveTimeout: 0 },
83+
session: { open: false },
84+
},
85+
ctx => [
86+
h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }),
87+
h(FloatingElements),
88+
],
89+
),
90+
}),
91+
}
92+
}
93+
7594
/**
7695
* Idle-collapsed: the default `autoCollapseEdgeToolbar` with `inactiveTimeout:
7796
* 0` (the same trick `Dock.stories.ts`'s own `Minimized` story uses) shrinks
7897
* the toolbar down to a small corner pill immediately, with nothing selected.
7998
*/
80-
export const CollapsedIdle: Story = {
81-
render: () => ({
82-
setup: () => mountWithContext(
83-
{
84-
entries: categorizedEntries,
85-
selectedId: null,
86-
panel: { mode: 'edge', position: 'bottom', inactiveTimeout: 0 },
87-
session: { open: false },
88-
},
89-
ctx => [
90-
h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }),
91-
h(FloatingElements),
92-
],
93-
),
94-
}),
95-
}
99+
export const CollapsedIdle: Story = collapsedEdgeStory('bottom')
100+
101+
/** Left edge collapsed to its idle logo pill. */
102+
export const CollapsedLeft: Story = collapsedEdgeStory('left')
103+
104+
/** Right edge collapsed to its idle logo pill. */
105+
export const CollapsedRight: Story = collapsedEdgeStory('right')
96106

97107
const settingsEntry: DevframeViewBuiltin = {
98108
type: '~builtin',

0 commit comments

Comments
 (0)