import * as __WEBPACK_EXTERNAL_MODULE__storybook_test__ from "@storybook/test";
import * as __WEBPACK_EXTERNAL_MODULE__TruncatedText_mjs__ from "./TruncatedText.mjs";
const meta = {
    title: 'Components/TruncatedText',
    component: __WEBPACK_EXTERNAL_MODULE__TruncatedText_mjs__["default"]
};
/* ESM default export */ const TruncatedText_stories_rslib_entry_ = meta;
const value = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
const Default = {
    args: {
        isTruncated: true,
        value
    }
};
const WithTooltipLabel = {
    args: {
        tooltipLabel: 'Label text',
        value: 'Lorem ipsum'
    },
    play: async ({ canvasElement, step })=>{
        const canvas = (0, __WEBPACK_EXTERNAL_MODULE__storybook_test__.within)(canvasElement);
        await step('Initially the tooltip label should not be displayed', async ()=>{
            (0, __WEBPACK_EXTERNAL_MODULE__storybook_test__.expect)(canvas.queryByText('Label text')).not.toBeInTheDocument();
        });
        __WEBPACK_EXTERNAL_MODULE__storybook_test__.userEvent.hover(canvas.getByText('Lorem ipsum'));
        await step('Hovering should display the tooltip label', async ()=>{
            await (0, __WEBPACK_EXTERNAL_MODULE__storybook_test__.waitFor)(()=>{
                // Need to use "screen" because by default tooltips appear outside the canvas element's parent element
                (0, __WEBPACK_EXTERNAL_MODULE__storybook_test__.expect)(__WEBPACK_EXTERNAL_MODULE__storybook_test__.screen.getByTestId('truncated-text-tooltip')).toBeVisible();
                (0, __WEBPACK_EXTERNAL_MODULE__storybook_test__.expect)(__WEBPACK_EXTERNAL_MODULE__storybook_test__.screen.getByTestId('truncated-text-tooltip')).toHaveTextContent('Label text');
            });
        });
    }
};
const NumberOfLines = {
    args: {
        value,
        noOfLines: [
            2,
            4,
            6
        ]
    }
};
export { Default, NumberOfLines, WithTooltipLabel, TruncatedText_stories_rslib_entry_ as default };
