import { describe, expect, it } from 'vitest' import { getPluginWorkspaceSidebarSlotNames, getPluginWorkspaceTopBarSlotNames, hasPluginWorkspaceSidebarSurface, } from '../../components/PluginWorkspaceView.shell' describe('PluginWorkspaceView shell helpers', () => { it('selects forwarded topbar and sidebar slots by key without depending on Vue slot return types', () => { const slots: Readonly> = { default: undefined, actions: undefined, 'settings-tab-analysis': undefined, header: undefined, 'collapsed-footer': undefined, 'section-import': undefined, unrelated: undefined, } expect(getPluginWorkspaceTopBarSlotNames(slots)).toEqual([ 'actions', 'settings-tab-analysis', ]) expect(getPluginWorkspaceSidebarSlotNames(slots)).toEqual([ 'header', 'collapsed-footer', 'section-import', ]) }) it('keeps the sidebar surface hidden when all sidebar inputs are empty', () => { expect(hasPluginWorkspaceSidebarSurface({ showSidebar: true, panels: {}, forms: {}, model: undefined, controls: undefined, showSidebarWhenEmpty: false, hasSidebarSlot: false, sidebarSlotCount: 0, })).toBe(false) }) })