import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { within, userEvent, expect } from '@storybook/test';
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, } from '../../ui/dropdown-menu.js';
import { OpenInControlCenterMenuItem } from './open-in-control-center-menu-item.js';
const meta = {
    title: 'ApplicationPage/OpenInControlCenterMenuItem',
    component: OpenInControlCenterMenuItem,
    parameters: { layout: 'centered' },
};
export default meta;
/**
 * **Default** — menu item rendered inside an open DropdownMenu so the
 * label and Sparkles icon are visible. Selecting it pushes to
 * `/create?applicationId=<id>&mode=spec` (router.push is stubbed in
 * Storybook).
 */
export const Default = {
    render: (args) => (_jsxs(DropdownMenu, { defaultOpen: true, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "rounded border px-3 py-1.5 text-sm", "aria-label": "Open menu", children: "Open menu" }) }), _jsx(DropdownMenuContent, { align: "end", children: _jsx(OpenInControlCenterMenuItem, { applicationId: args.applicationId }) })] })),
    args: {
        applicationId: 'app-001',
    },
    play: async ({ canvasElement }) => {
        const body = within(canvasElement.ownerDocument.body);
        const item = await body.findByTestId('open-in-control-center-sdd-menu-item');
        await expect(item).toBeInTheDocument();
    },
};
/**
 * **Hovered** — verifies the cursor state and accessible label by
 * hovering the menu item once it's rendered.
 */
export const Hovered = {
    render: (args) => (_jsxs(DropdownMenu, { defaultOpen: true, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "rounded border px-3 py-1.5 text-sm", "aria-label": "Open menu", children: "Open menu" }) }), _jsx(DropdownMenuContent, { align: "end", children: _jsx(OpenInControlCenterMenuItem, { applicationId: args.applicationId }) })] })),
    args: {
        applicationId: 'app-002',
    },
    play: async ({ canvasElement }) => {
        const body = within(canvasElement.ownerDocument.body);
        const item = await body.findByTestId('open-in-control-center-sdd-menu-item');
        await userEvent.hover(item);
    },
};
