openpencil/src/components/LayerTree/LayerTree.stories.ts
Danila Poyarkov 7bfebce0bf feat(editor): scale and theme Layers panel
- Add indexed visible rows, virtual scroll-to-selection, and range selection

- Move Layer Tree state styling into typed Tailwind Variants slots

- Enforce parsed Vue state-class theming and cover 5,000-node documents
2026-07-17 17:23:16 +03:00

42 lines
1.3 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { expect, within } from 'storybook/test'
import LayerTreeThemeDemo from './demo/LayerTreeThemeDemo.vue'
const meta = {
title: 'Design System/Editor/Layer Tree',
component: LayerTreeThemeDemo,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component:
'Layer Tree theme states for selection focus, visibility, locking, dragging, drop instructions, and rename.'
}
}
}
} satisfies Meta<typeof LayerTreeThemeDemo>
export default meta
type Story = StoryObj<typeof meta>
export const StateMatrix: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement)
await expect(canvas.getByLabelText('Selected focused').firstElementChild).toHaveAttribute(
'data-focused'
)
await expect(canvas.getByLabelText('Selected unfocused').firstElementChild).toHaveAttribute(
'data-selected'
)
await expect(canvas.getByLabelText('Hidden').firstElementChild).toHaveAttribute('data-hidden')
await expect(canvas.getByLabelText('Dragging').firstElementChild).toHaveAttribute(
'data-dragging'
)
await expect(canvas.getByLabelText('Child drop').firstElementChild).toHaveAttribute(
'data-drop-position',
'child'
)
}
}