/* @oracle/oraclejet-preact: undefined */
import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
import { screen, waitFor, fireEvent, render } from '@testing-library/preact';
import userEvent from '@testing-library/user-event';
import { expect } from 'chai';
import { s as setupUseTextDimensionsDependenciesMock } from '../../mockUseTextDimensionsDependencies-83fdfb98.js';
import { m as matchTranslationBundle } from '../../matchTranslationBundle-d9e64706.js';
import '../../LayerHost-e6402730.js';
import { R as RootEnvironmentProvider } from '../../EnvironmentProvider-bada8909.js';
import '../../TabbableModeContext-7d8ad946.js';
import 'preact/hooks';
import { a as queryAllBy, c as checkTooltipText } from '../../domUtil-90e55ab7.js';
import { m as mockMouseEventPageXYOffsetXY, r as restoreMouseEventPageXYOffsetXY } from '../../eventUtils-447f1bf1.js';
import { g as getClientHints } from '../../clientHints-f850225e.js';
import '../../Menu-a5bf756f.js';
import { l as MenuItem } from '../../MenuItem-54015ca3.js';
import 'preact';
import '../../logger-c92f309c.js';
import './../../TooltipContentStyles.styles.css';
import './../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.styles.css';
import '../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js';
import '../../tooltipUtils-768450a7.js';
import './../../IconStyle.styles.css';
import '../../SelectMenuGroupContext-b56cf5d4.js';
import '../../UNSAFE_Separator/themes/SeparatorStyles.css.js';
import './../../MenuSeparatorStyles.styles.css';
import './../../UNSAFE_Menu/themes/redwood/MenuSeparatorBaseTheme.styles.css';
import '../../UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js';
import 'preact/compat';
import { g as getMenuItemByRole, a as getAllMenuItemsByRole, b as getLabel } from '../../menuTestsUtils-c74ce3da.js';
import { t as testDnd, g as getDndCallbacks } from '../../dndUtils-9fb07485.js';
import { B as BarChart } from '../../BarChart-43dec3b7.js';
import '../../Common/themes/redwood/theme.js';
import '../../Common/themes/themeContract.css.js';
import '../../UNSAFE_Layer/themes/LayerHostStyles.css.js';
import './../../LayerHostStyles.styles.css';
import '../../LayerManager-fa745cec.js';
import '../../Dropdown-60833900.js';
import '../../Floating-f02677ba.js';
import '../../useFloating-953362cf.js';
import '../../useUser-1cd223a9.js';
import '../../positionUtils-f26caad9.js';
import '../../refUtils-b9d8d91a.js';
import '../../useOutsideClick-fd9ad806.js';
import '../../arrayUtils-35a58161.js';
import '../../Layer-446bf21e.js';
import '../../classNames-4e12b00d.js';
import '../../UNSAFE_Layer/themes/LayerStyles.css.js';
import './../../LayerStyles.styles.css';
import '../../useThemeInterpolations-8dd8029f.js';
import '../../useColorScheme-c4e237ad.js';
import '../../useScale-83881775.js';
import '../../theme-63551f30.js';
import '../../Theme-e6dec6db.js';
import '../../mergeInterpolations-e2db2a66.js';
import '../../mergeDeepWithKey-08531060.js';
import '../../_curry3-0b4222d7.js';
import '../../_curry1-25297e59.js';
import '../../_curry2-34316bcf.js';
import '../../_isObject-1fab0f5b.js';
import '../../useDensity-c17603b2.js';
import '../../useModal-953082f2.js';
import '../../useComponentTheme-d2f9e47f.js';
import '../../utils-a4102e03.js';
import '../../colorUtils-16eb823f.js';
import '../../UNSAFE_Floating/themes/redwood/FloatingTheme.js';
import '../../UNSAFE_Floating/themes/FloatingStyles.css.js';
import './../../FloatingStyles.styles.css';
import '../../UNSAFE_Floating/themes/redwood/FloatingBaseTheme.css.js';
import './../../UNSAFE_Floating/themes/redwood/FloatingBaseTheme.styles.css';
import '../../UNSAFE_Floating/themes/redwood/FloatingVariants.css.js';
import '../../vanilla-extract-recipes-createRuntimeFn.esm-2aaf8c98.js';
import '../../vanilla-extract-dynamic.esm-2955d60a.js';
import '../../UNSAFE_Floating/themes/FloatingContract.css.js';
import '../../keyboardUtils-38854729.js';
import '../../tabbableUtils-6ceb767f.js';
import '../../head-6f17c50c.js';
import '../../_arity-be492b9e.js';
import '../../_isArray-694cc52d.js';
import '../../_isString-675f1de9.js';
import '../../usePopupAnimation-f017bc43.js';
import '../../useAnimationStatus-a9337dd8.js';
import '../../useAnimation-a5eb7604.js';
import '../../popupAnimationUtils-175151d9.js';
import '../../CollectionInteractionContext-7cf19abc.js';
import '../../UNSAFE_Dropdown/themes/dropdownStyles.css.js';
import './../../dropdownStyles.styles.css';
import '../../useOutsideMousedown-7307de8b.js';
import '../../animationUtils-e6081007.js';
import '../../mergeProps-88ea8306.js';
import '../../UNSAFE_Menu/themes/MenuStyles.css.js';
import './../../MenuStyles.styles.css';
import '../../useTestId-9b504481.js';
import '../../UNSAFE_Menu/themes/DropdownMenuStyles.css.js';
import './../../DropdownMenuStyles.styles.css';
import '../../Sheet-da412baf.js';
import '../../Modal-24a0bf4b.js';
import '../../UNSAFE_Modal/themes/ModalStyles.css.js';
import './../../ModalStyles.styles.css';
import '../../popupUtils-58411a98.js';
import '../../WindowOverlay-a07b2e24.js';
import '../../UNSAFE_WindowOverlay/themes/WindowOverlayStyles.css.js';
import './../../WindowOverlayStyles.styles.css';
import '../../UNSAFE_WindowOverlay/themes/WindowOverlayContract.css.js';
import '../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayTheme.js';
import '../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.css.js';
import './../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.styles.css';
import '../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayVariants.css.js';
import '../../UNSAFE_Sheet/themes/SheetStyles.css.js';
import './../../SheetStyles.styles.css';
import '../../UNSAFE_Menu/themes/SheetMenuStyles.css.js';
import './../../SheetMenuStyles.styles.css';
import '../../Text-f8d4ff78.js';
import '../../UNSAFE_Text/themes/TextStyles.css.js';
import './../../TextStyles.styles.css';
import '../../useId-03dbfdf0.js';
import '../../usePress-051f5adb.js';
import '../../flexitem-7b7f7920.js';
import './../../flexitem.styles.css';
import '../../vanilla-extract-sprinkles-createRuntimeSprinkles.esm-2d655d37.js';
import '../../useInteractionStyle-52222fdd.js';
import '../../useHover-19340c22.js';
import '../../useToggle-8b7fcefe.js';
import '../../useActive-fb6d4d52.js';
import '../../UNSAFE_Menu/themes/redwood/MenuItemTheme.js';
import '../../UNSAFE_Menu/themes/MenuItemStyles.css.js';
import './../../MenuItemStyles.styles.css';
import '../../UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.css.js';
import './../../UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.styles.css';
import '../../UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js';
import './../../MenuItemVariants.styles.css';
import './../../TooltipContentVariants.styles.css';
import './../../SeparatorStyles.styles.css';
import '../../BarGroup-dbf70e2c.js';
import '../../PRIVATE_Chart/themes/ChartStyles.css.js';
import './../../ChartStyles.styles.css';
import '../../layoutUtils-5d62f2b4.js';
import '../../scale-3b7850b9.js';
import '../../labelUtils-ec7f939f.js';
import '../../textUtils-3ed25dd1.js';
import '../../accUtils-ce2d6588.js';
import '../../utils-d451497b.js';
import '../../datatipUtils-13ab34b7.js';
import '../../clientUtils-0df8cb15.js';
import '../../dimensionUtils-6d5dac30.js';
import '../../getLocale-1c41e86a.js';
import '../../stringUtils-16f617bc.js';
import '../../useTranslationBundle-09302c20.js';
import '../../dataStyleUtils-1e980302.js';
import '../../colorUtils-35e3dd2b.js';
import '../../useChartDnd-fc7ba21c.js';
import '../../eventsUtils-e5fc62d5.js';
import '../../utils-43235750.js';
import '../../pathUtils-1a478322.js';
import '../../useDnd-c5ae190c.js';
import '../../Chart-4ec13697.js';
import '../../TrackResizeContainer-04a2c642.js';
import '../../useSize-9eea84eb.js';
import '../../useResizeObserver-838164c1.js';
import '../../useVisAddBusyState-994e0324.js';
import '../../VisBusyStateContext-9ae84b1d.js';
import '../../useVisBusyStateContext-a1df0764.js';
import '../../size-18139a3a.js';
import '../../useTextDimensions-e08928cc.js';
import '../../useCssVars-d72a8439.js';
import '../../useTheme-93c07059.js';
import '../../Gridlines-6098cb5b.js';
import '../../PRIVATE_PlotArea/themes/PlotAreaStyles.css.js';
import './../../PlotAreaStyles.styles.css';
import '../../hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css.js';
import './../../VisDndStyles.styles.css';
import '../../Axis-9e78ee61.js';
import '../../PRIVATE_Axis/themes/AxisStyles.css.js';
import './../../AxisStyles.styles.css';
import '../../MultilineText-03e1e46c.js';
import '../../PRIVATE_Axis/themes/redwood/AxisTheme.js';
import '../../PRIVATE_Axis/themes/redwood/AxisBaseTheme.css.js';
import './../../PRIVATE_Axis/themes/redwood/AxisBaseTheme.styles.css';
import '../../PRIVATE_Axis/themes/redwood/AxisVariants.css.js';
import '../../useChartViewport-1e396126.js';
import '../../usePinch-301da5f6.js';
import '../../usePointerGesture-ddf231cc.js';
import '../../useChartNav-19d0b379.js';
import '../../layoutUtils-d7613d0c.js';
import '../../useVisHover-d7a0b2f3.js';
import '../../useSelectDrill-f4781439.js';
import '../../useChartDataCursor-a5be166c.js';
import '../../hooks/PRIVATE_useChartDataCursor/themes/DataCursorStyles.css.js';
import './../../DataCursorStyles.styles.css';
import '../../Marker-147d98cf.js';
import './../../SvgShapesStyles.styles.css';
import '../../useChartDatatip-d6a6c5e1.js';
import '../../useDatatip-9635bc2f.js';
import '../../hooks/PRIVATE_useDatatip/themes/useDatatip.css.js';
import './../../useDatatip.styles.css';
import '../../VisTabularDatatip-59629377.js';
import '../../PRIVATE_VisTabularDatatip/themes/VisTabularDatatipStyles.css.js';
import './../../VisTabularDatatipStyles.styles.css';
import '../../useChartDrill-676e05ad.js';
import '../../useVisDrill-21902134.js';
import '../../useDoubleTap-4e290707.js';
import '../../useSelection-0bd0618d.js';
import '../../BaseButton-61f6baa8.js';
import '../../usePressClick-945cc43b.js';
import '../../useTabbableMode-a3a351d0.js';
import '../../dimensions-d4159ace.js';
import '../../UNSAFE_BaseButton/themes/redwood/BaseButtonTheme.js';
import '../../UNSAFE_BaseButton/themes/BaseButtonStyles.css.js';
import './../../BaseButtonStyles.styles.css';
import '../../UNSAFE_BaseButton/themes/redwood/BaseButtonVariants.css.js';
import './../../UNSAFE_BaseButton/themes/redwood/BaseButtonBaseTheme.styles.css';
import '../../hooks/PRIVATE_useVisSelection/themes/ClearSelection.css.js';
import './../../ClearSelection.styles.css';
import '../../cssUtils-71c7d7b0.js';
import '../../useChartContextMenu-61fe46b8.js';
import '../../useContextMenu-3c62d9eb.js';
import '../../useContextMenuGesture-9b95a1bb.js';
import '../../textSelectionUtils-a6554a42.js';
import '../../useTooltip-89ca3f3e.js';
import '../../useFocus-38c95977.js';
import '../../useTouch-4828df25.js';
import '../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentTheme.js';
import '../../hooks/UNSAFE_useTooltip/themes/TooltipContentStyles.css.js';
import '../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.css.js';
import '../../useChartMarquee-7cd47205.js';
import '../../useVisDragModeControls-ed260d12.js';
import '../../Button-a57d82a7.js';
import '../../Icon-030b6dd4.js';
import '../../UNSAFE_Icon/themes/IconStyle.css.js';
import '../../Move-cf6a8bb2.js';
import '../../hooks/PRIVATE_useVisDragModeControls/themes/useVisDragModeControls.css.js';
import './../../useVisDragModeControls.styles.css';
import '../../ZoomAlt-df2dab3a.js';
import '../../ButtonSetSingle-8a4c0e0c.js';
import '../../useButtonSetContext-6a483d7f.js';
import '../../ButtonSet-9b2c41be.js';
import '../../UNSAFE_ButtonSet/themes/ButtonSetStyles.css.js';
import './../../ButtonSetStyles.styles.css';
import '../../ButtonSetPositionContext-5730d367.js';
import '../../toggleButtonUtils-75e3d781.js';
import '../../useRovingTabIndexContainer-bc7ae447.js';
import '../../buttonUtils-be059939.js';
import '../../id-83adac50.js';
import '../../ButtonSetItem-eb2d43d4.js';
import '../../ButtonSetButton-974fc462.js';
import '../../ToggleButtonLabel-bd186454.js';
import '../../ButtonLabelLayout-e9f8cbc0.js';
import '../../useButtonLabelLayoutTheme-a1b95a52.js';
import '../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutTheme.js';
import '../../UNSAFE_ButtonLabelLayout/themes/ButtonLabelLayoutStyles.css.js';
import './../../ButtonLabelLayoutStyles.styles.css';
import '../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.css.js';
import './../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.styles.css';
import '../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutVariants.css.js';
import './../../ButtonLabelLayoutVariants.styles.css';
import '../../HiddenAccessible-61197e7c.js';
import './../../HiddenAccessibleStyles.styles.css';
import '../../ButtonSetIconButton-0081167a.js';
import '../../useButtonSetPositionContext-1dc5156a.js';
import '../../IconToggleButton-94cbea2b.js';
import '../../useToggleAction-fc0f5399.js';
import '../../hooks/PRIVATE_useChartMarquee/themes/useChartMarquee.css.js';
import './../../useChartMarquee.styles.css';
import '../../useVisTouchResponse-a59ab166.js';
import '../../useOverviewContext-79377674.js';
import '../../OverviewSlidingWindow-8936526e.js';
import '../../PRIVATE_VisOverview/themes/VisOverview.css.js';
import './../../VisOverview.styles.css';
import '../../DragH-6753bb51.js';
import '../../ScrollBar-a431a4f0.js';
import '../../PRIVATE_ChartScrollBar/themes/ScrollBarStyles.css.js';
import './../../ScrollBarStyles.styles.css';

const gdpData = [
    {
        id: 1,
        gdp: 15684750000000,
        country: 'United States'
    },
    {
        id: 2,
        gdp: 8227037000000,
        country: 'China'
    },
    {
        id: 3,
        gdp: 5963969000000,
        country: 'Japan '
    },
    {
        id: 4,
        gdp: 3400579000000,
        country: 'Germany '
    },
    {
        id: 5,
        gdp: 2608699000000,
        country: 'France'
    },
    {
        id: 6,
        gdp: 2440505000000,
        country: 'United Kingdom'
    },
    {
        id: 7,
        gdp: 2395968000000,
        country: 'Brazil '
    },
    {
        id: 8,
        gdp: 2021960000000,
        country: 'Russia'
    },
    {
        id: 9,
        gdp: 2014079000000,
        country: 'Italy'
    },
    {
        id: 10,
        gdp: 1824832000000,
        country: 'India'
    },
    {
        id: 11,
        gdp: 1819081000000,
        country: 'Canada'
    },
    {
        id: 12,
        gdp: 1541797000000,
        country: 'Australia'
    },
    {
        id: 13,
        gdp: 1352057000000,
        country: 'Spain'
    },
    {
        id: 14,
        gdp: 1177116000000,
        country: 'Mexico'
    },
    {
        id: 15,
        gdp: 1155872000000,
        country: 'South Korea'
    },
    {
        id: 16,
        gdp: 878198000000,
        country: 'Indonesia'
    },
    {
        id: 17,
        gdp: 794468000000,
        country: 'Turkey'
    },
    {
        id: 18,
        gdp: 773116000000,
        country: 'Netherlands'
    },
    {
        id: 19,
        gdp: 727307000000,
        country: 'Saudi Arabia'
    },
    {
        id: 20,
        gdp: 632400000000,
        country: 'Switzerland'
    },
    {
        id: 21,
        gdp: 548895000000,
        country: 'Iran'
    },
    {
        id: 22,
        gdp: 526192000000,
        country: 'Sweden'
    },
    {
        id: 23,
        gdp: 501101000000,
        country: 'Norway'
    },
    {
        id: 24,
        gdp: 487674000000,
        country: 'Poland'
    },
    {
        id: 25,
        gdp: 484692000000,
        country: 'Belgium'
    },
    {
        id: 26,
        gdp: 474954000000,
        country: 'Argentina'
    },
    {
        id: 27,
        gdp: 473971000000,
        country: 'Taiwan'
    },
    {
        id: 28,
        gdp: 398594000000,
        country: 'Austria'
    },
    {
        id: 29,
        gdp: 384315000000,
        country: 'South Africa'
    },
    {
        id: 30,
        gdp: 382424000000,
        country: 'Venezuela'
    },
    {
        id: 31,
        gdp: 366020000000,
        country: 'Colombia'
    },
    {
        id: 32,
        gdp: 365564000000,
        country: 'Thailand'
    },
    {
        id: 33,
        gdp: 358940000000,
        country: 'United Arab Emirates'
    },
    {
        id: 34,
        gdp: 313637000000,
        country: 'Denmark'
    },
    {
        id: 35,
        gdp: 303527000000,
        country: 'Malaysia'
    },
    {
        id: 36,
        gdp: 276520000000,
        country: 'Singapore'
    },
    {
        id: 37,
        gdp: 268708000000,
        country: 'Nigeria'
    },
    {
        id: 38,
        gdp: 268177000000,
        country: 'Chile'
    },
    {
        id: 39,
        gdp: 263021000000,
        country: 'Hong Kong'
    },
    {
        id: 40,
        gdp: 256729000000,
        country: 'Egypt'
    },
    {
        id: 41,
        gdp: 250436000000,
        country: 'Philippines'
    },
    {
        id: 42,
        gdp: 250126000000,
        country: 'Finland'
    },
    {
        id: 43,
        gdp: 249201000000,
        country: 'Greece'
    },
    {
        id: 44,
        gdp: 240894000000,
        country: 'Israel'
    },
    {
        id: 45,
        gdp: 231879000000,
        country: 'Pakistan'
    },
    {
        id: 46,
        gdp: 212720000000,
        country: 'Portugal'
    },
    {
        id: 47,
        gdp: 212501000000,
        country: 'Iraq'
    },
    {
        id: 48,
        gdp: 210416000000,
        country: 'Ireland'
    },
    {
        id: 49,
        gdp: 207794000000,
        country: 'Algeria'
    },
    {
        id: 50,
        gdp: 199003000000,
        country: 'Paraguay'
    },
    {
        id: 51,
        gdp: 199003000000,
        country: 'Peru'
    },
    {
        id: 52,
        gdp: 196419000000,
        country: 'Kazakhstan'
    },
    {
        id: 53,
        gdp: 196072000000,
        country: 'Czech Republic'
    },
    {
        id: 54,
        gdp: 183378000000,
        country: 'Qatar'
    },
    {
        id: 55,
        gdp: 176235000000,
        country: 'Ukraine'
    },
    {
        id: 56,
        gdp: 173424000000,
        country: 'Kuwait'
    },
    {
        id: 57,
        gdp: 169680000000,
        country: 'New Zealand'
    },
    {
        id: 58,
        gdp: 169680000000,
        country: 'Romania'
    },
    {
        id: 59,
        gdp: 138071000000,
        country: 'Vietnam'
    },
    {
        id: 60,
        gdp: 126873000000,
        country: 'Hungary'
    },
    {
        id: 61,
        gdp: 122724000000,
        country: 'Bangladesh'
    },
    {
        id: 62,
        gdp: 118719000000,
        country: 'Angola'
    },
    {
        id: 63,
        gdp: 97530000000,
        country: 'Morocco'
    },
    {
        id: 64,
        gdp: 91916000000,
        country: 'Slovakia'
    },
    {
        id: 65,
        gdp: 81915000000,
        country: 'Libya'
    },
    {
        id: 66,
        gdp: 80927000000,
        country: 'Ecuador'
    },
    {
        id: 67,
        gdp: 76464000000,
        country: 'Oman'
    },
    {
        id: 68,
        gdp: 68804000000,
        country: 'Azerbaijan'
    },
    {
        id: 69,
        gdp: 63259000000,
        country: 'Belarus'
    },
    {
        id: 70,
        gdp: 59941000000,
        country: 'Sudan'
    },
    {
        id: 71,
        gdp: 59408000000,
        country: 'Sri Lanka'
    },
    {
        id: 72,
        gdp: 58996000000,
        country: 'Dominican Republic'
    },
    {
        id: 73,
        gdp: 57102000000,
        country: 'Croatia'
    },
    {
        id: 74,
        gdp: 56738000000,
        country: 'Luxembourg'
    },
    {
        id: 75,
        gdp: 53140000000,
        country: 'Burma'
    },
    {
        id: 76,
        gdp: 51168000000,
        country: 'Uzbekistan'
    },
    {
        id: 77,
        gdp: 51020000000,
        country: 'Bulgaria'
    },
    {
        id: 78,
        gdp: 49880000000,
        country: 'Guatemala'
    },
    {
        id: 79,
        gdp: 49404000000,
        country: 'Uruguay'
    },
    {
        id: 80,
        gdp: 45617000000,
        country: 'Slovenia'
    },
    {
        id: 81,
        gdp: 45611000000,
        country: 'Tunisia'
    },
    {
        id: 82,
        gdp: 45134000000,
        country: 'Costa Rica'
    },
    {
        id: 83,
        gdp: 42164000000,
        country: 'Lithuania'
    },
    {
        id: 84,
        gdp: 41906000000,
        country: 'Ethiopia'
    },
    {
        id: 85,
        gdp: 41345000000,
        country: 'Lebanon'
    },
    {
        id: 86,
        gdp: 41117000000,
        country: 'Kenya'
    },
    {
        id: 87,
        gdp: 38939000000,
        country: 'Ghana'
    },
    {
        id: 88,
        gdp: 37399000000,
        country: 'Serbia'
    },
    {
        id: 89,
        gdp: 36253000000,
        country: 'Panama'
    },
    {
        id: 90,
        gdp: 35641000000,
        country: 'Yemen'
    },
    {
        id: 91,
        gdp: 33679000000,
        country: 'Turkmenistan'
    },
    {
        id: 92,
        gdp: 31209000000,
        country: 'Jordan'
    },
    {
        id: 93,
        gdp: 28380000000,
        country: 'Latvia'
    },
    {
        id: 94,
        gdp: 28247000000,
        country: 'Tanzania'
    },
    {
        id: 95,
        gdp: 27429000000,
        country: 'Bolivia'
    },
    {
        id: 96,
        gdp: 27026000000,
        country: 'Bahrain'
    },
    {
        id: 97,
        gdp: 25277000000,
        country: 'Trinidad and Tobago'
    },
    {
        id: 98,
        gdp: 25005000000,
        country: 'Cameroon'
    },
    {
        id: 99,
        gdp: 24627000000,
        country: "Cote d'Ivoire"
    },
    {
        id: 100,
        gdp: 23816000000,
        country: 'El Salvador'
    },
    {
        id: 101,
        gdp: 23006000000,
        country: 'Cyprus'
    },
    {
        id: 102,
        gdp: 21863000000,
        country: 'Estonia'
    },
    {
        id: 103,
        gdp: 21002000000,
        country: 'Uganda'
    },
    {
        id: 104,
        gdp: 20517000000,
        country: 'Zambia'
    },
    {
        id: 105,
        gdp: 19906000000,
        country: 'Afghanistan'
    },
    {
        id: 106,
        gdp: 19415000000,
        country: 'Nepal'
    },
    {
        id: 107,
        gdp: 18388000000,
        country: 'Honduras'
    },
    {
        id: 108,
        gdp: 18376000000,
        country: 'Gabon'
    },
    {
        id: 109,
        gdp: 17703000000,
        country: 'Congo, Democratic Republic of the'
    },
    {
        id: 110,
        gdp: 17624000000,
        country: 'Botswana'
    },
    {
        id: 111,
        gdp: 17326000000,
        country: 'Bosnia and Herzegovina'
    },
    {
        id: 112,
        gdp: 17206000000,
        country: 'Equatorial Guinea'
    },
    {
        id: 113,
        gdp: 16628000000,
        country: 'Brunei'
    },
    {
        id: 114,
        gdp: 15934000000,
        country: 'Georgia'
    },
    {
        id: 115,
        gdp: 15786000000,
        country: 'Papua New Guinea'
    },
    {
        id: 116,
        gdp: 15249000000,
        country: 'Jamaica'
    },
    {
        id: 117,
        gdp: 14600000000,
        country: 'Mozambique'
    },
    {
        id: 118,
        gdp: 14241000000,
        country: 'Cambodia'
    },
    {
        id: 119,
        gdp: 13864000000,
        country: 'Senegal'
    },
    {
        id: 120,
        gdp: 13692000000,
        country: 'Congo, Republic of the'
    },
    {
        id: 121,
        gdp: 13654000000,
        country: 'Iceland'
    },
    {
        id: 122,
        gdp: 12688000000,
        country: 'Albania'
    },
    {
        id: 123,
        gdp: 12299000000,
        country: 'Namibia'
    },
    {
        id: 124,
        gdp: 12202000000,
        country: 'South Sudan'
    },
    {
        id: 125,
        gdp: 11466000000,
        country: 'Mauritius'
    },
    {
        id: 126,
        gdp: 10806000000,
        country: 'Chad'
    },
    {
        id: 127,
        gdp: 10646000000,
        country: 'Burkina Faso'
    },
    {
        id: 128,
        gdp: 10506000000,
        country: 'Nicaragua'
    },
    {
        id: 129,
        gdp: 10319000000,
        country: 'Mali'
    },
    {
        id: 130,
        gdp: 10258000000,
        country: 'Mongolia'
    },
    {
        id: 131,
        gdp: 10117000000,
        country: 'Madagascar'
    },
    {
        id: 132,
        gdp: 10066000000,
        country: 'Armenia'
    },
    {
        id: 133,
        gdp: 9802000000,
        country: 'Zimbabwe'
    },
    {
        id: 134,
        gdp: 9676000000,
        country: 'Macedonia, Republic of'
    },
    {
        id: 135,
        gdp: 9217000000,
        country: 'Laos'
    },
    {
        id: 136,
        gdp: 8689000000,
        country: 'Malta'
    },
    {
        id: 137,
        gdp: 8043000000,
        country: 'Bahamas, The'
    },
    {
        id: 138,
        gdp: 7902000000,
        country: 'Haiti'
    },
    {
        id: 139,
        gdp: 7592000000,
        country: 'Tajikistan'
    },
    {
        id: 140,
        gdp: 7429000000,
        country: 'Benin'
    },
    {
        id: 141,
        gdp: 7252000000,
        country: 'Moldova'
    },
    {
        id: 142,
        gdp: 7223000000,
        country: 'Rwanda'
    },
    {
        id: 143,
        gdp: 6575000000,
        country: 'Niger'
    },
    {
        id: 144,
        gdp: 6473000000,
        country: 'Kyrgyzstan'
    },
    {
        id: 145,
        gdp: 5632000000,
        country: 'Guinea'
    },
    {
        id: 146,
        gdp: 4738000000,
        country: 'Suriname'
    },
    {
        id: 147,
        gdp: 4490000000,
        country: 'Barbados'
    },
    {
        id: 148,
        gdp: 4280000000,
        country: 'Montenegro'
    },
    {
        id: 149,
        gdp: 4212000000,
        country: 'Malawi'
    },
    {
        id: 150,
        gdp: 4199000000,
        country: 'Mauritania'
    },
    {
        id: 151,
        gdp: 4173000000,
        country: 'Timor-Leste'
    },
    {
        id: 152,
        gdp: 3996000000,
        country: 'Fiji'
    },
    {
        id: 153,
        gdp: 3777000000,
        country: 'Sierra Leone'
    },
    {
        id: 154,
        gdp: 3751000000,
        country: 'Swaziland'
    },
    {
        id: 155,
        gdp: 3685000000,
        country: 'Togo'
    },
    {
        id: 156,
        gdp: 3092000000,
        country: 'Eritrea'
    },
    {
        id: 157,
        gdp: 2788000000,
        country: 'Guyana'
    },
    {
        id: 158,
        gdp: 2475000000,
        country: 'Burundi'
    },
    {
        id: 159,
        gdp: 2439000000,
        country: 'Lesotho'
    },
    {
        id: 160,
        gdp: 2209000000,
        country: 'Maldives'
    },
    {
        id: 161,
        gdp: 2196000000,
        country: 'Bhutan'
    },
    {
        id: 162,
        gdp: 2172000000,
        country: 'Central African Republic'
    },
    {
        id: 163,
        gdp: 1899000000,
        country: 'Cape Verde'
    },
    {
        id: 164,
        gdp: 1855000000,
        country: 'San Marino'
    },
    {
        id: 165,
        gdp: 1735000000,
        country: 'Liberia'
    },
    {
        id: 166,
        gdp: 1554000000,
        country: 'Belize'
    },
    {
        id: 167,
        gdp: 1354000000,
        country: 'Djibouti'
    },
    {
        id: 168,
        gdp: 1220000000,
        country: 'Saint Lucia'
    },
    {
        id: 169,
        gdp: 1176000000,
        country: 'Antigua and Barbuda'
    },
    {
        id: 170,
        gdp: 1031000000,
        country: 'Seychelles'
    },
    {
        id: 171,
        gdp: 1010000000,
        country: 'Solomon Islands'
    },
    {
        id: 172,
        gdp: 918000000,
        country: 'Gambia, The'
    },
    {
        id: 173,
        gdp: 870000000,
        country: 'Guinea-Bissau'
    },
    {
        id: 174,
        gdp: 790000000,
        country: 'Grenada'
    },
    {
        id: 175,
        gdp: 783000000,
        country: 'Vanuatu'
    },
    {
        id: 176,
        gdp: 734000000,
        country: 'Saint Kitts and Nevis'
    },
    {
        id: 177,
        gdp: 712000000,
        country: 'Saint Vincent and the Grenadines'
    },
    {
        id: 178,
        gdp: 683000000,
        country: 'Samoa'
    },
    {
        id: 179,
        gdp: 600000000,
        country: 'Comoros'
    },
    {
        id: 180,
        gdp: 497000000,
        country: 'Dominica'
    },
    {
        id: 181,
        gdp: 476000000,
        country: 'Tonga'
    },
    {
        id: 182,
        gdp: 264000000,
        country: 'Sao Tome and Principe'
    },
    {
        id: 183,
        gdp: 173000000,
        country: 'Kiribati'
    },
    {
        id: 0,
        gdp: 37000000,
        country: 'Tuvalu'
    }
];

function __variableDynamicImportRuntime0__(path) {
  switch (path) {
    case '../../resources/nls/ar/bundle.ts': return import('../../resources/nls/ar/bundle.js');
    case '../../resources/nls/ar-XB/bundle.ts': return import('../../resources/nls/ar-XB/bundle.js');
    case '../../resources/nls/bg/bundle.ts': return import('../../resources/nls/bg/bundle.js');
    case '../../resources/nls/bs/bundle.ts': return import('../../resources/nls/bs/bundle.js');
    case '../../resources/nls/bs-Cyrl/bundle.ts': return import('../../resources/nls/bs-Cyrl/bundle.js');
    case '../../resources/nls/cs/bundle.ts': return import('../../resources/nls/cs/bundle.js');
    case '../../resources/nls/da/bundle.ts': return import('../../resources/nls/da/bundle.js');
    case '../../resources/nls/de/bundle.ts': return import('../../resources/nls/de/bundle.js');
    case '../../resources/nls/el/bundle.ts': return import('../../resources/nls/el/bundle.js');
    case '../../resources/nls/en/bundle.ts': return import('../../resources/nls/en/bundle.js');
    case '../../resources/nls/en-XA/bundle.ts': return import('../../resources/nls/en-XA/bundle.js');
    case '../../resources/nls/en-XC/bundle.ts': return import('../../resources/nls/en-XC/bundle.js');
    case '../../resources/nls/es/bundle.ts': return import('../../resources/nls/es/bundle.js');
    case '../../resources/nls/et/bundle.ts': return import('../../resources/nls/et/bundle.js');
    case '../../resources/nls/fi/bundle.ts': return import('../../resources/nls/fi/bundle.js');
    case '../../resources/nls/fr/bundle.ts': return import('../../resources/nls/fr/bundle.js');
    case '../../resources/nls/fr-CA/bundle.ts': return import('../../resources/nls/fr-CA/bundle.js');
    case '../../resources/nls/he/bundle.ts': return import('../../resources/nls/he/bundle.js');
    case '../../resources/nls/hr/bundle.ts': return import('../../resources/nls/hr/bundle.js');
    case '../../resources/nls/hu/bundle.ts': return import('../../resources/nls/hu/bundle.js');
    case '../../resources/nls/is/bundle.ts': return import('../../resources/nls/is/bundle.js');
    case '../../resources/nls/it/bundle.ts': return import('../../resources/nls/it/bundle.js');
    case '../../resources/nls/ja/bundle.ts': return import('../../resources/nls/ja/bundle.js');
    case '../../resources/nls/ko/bundle.ts': return import('../../resources/nls/ko/bundle.js');
    case '../../resources/nls/lt/bundle.ts': return import('../../resources/nls/lt/bundle.js');
    case '../../resources/nls/lv/bundle.ts': return import('../../resources/nls/lv/bundle.js');
    case '../../resources/nls/ms/bundle.ts': return import('../../resources/nls/ms/bundle.js');
    case '../../resources/nls/nl/bundle.ts': return import('../../resources/nls/nl/bundle.js');
    case '../../resources/nls/no/bundle.ts': return import('../../resources/nls/no/bundle.js');
    case '../../resources/nls/pl/bundle.ts': return import('../../resources/nls/pl/bundle.js');
    case '../../resources/nls/pt/bundle.ts': return import('../../resources/nls/pt/bundle.js');
    case '../../resources/nls/pt-PT/bundle.ts': return import('../../resources/nls/pt-PT/bundle.js');
    case '../../resources/nls/ro/bundle.ts': return import('../../resources/nls/ro/bundle.js');
    case '../../resources/nls/ru/bundle.ts': return import('../../resources/nls/ru/bundle.js');
    case '../../resources/nls/sk/bundle.ts': return import('../../resources/nls/sk/bundle.js');
    case '../../resources/nls/sl/bundle.ts': return import('../../resources/nls/sl/bundle.js');
    case '../../resources/nls/sr/bundle.ts': return import('../../resources/nls/sr/bundle.js');
    case '../../resources/nls/sr-Latn/bundle.ts': return import('../../resources/nls/sr-Latn/bundle.js');
    case '../../resources/nls/sv/bundle.ts': return import('../../resources/nls/sv/bundle.js');
    case '../../resources/nls/th/bundle.ts': return import('../../resources/nls/th/bundle.js');
    case '../../resources/nls/tr/bundle.ts': return import('../../resources/nls/tr/bundle.js');
    case '../../resources/nls/uk/bundle.ts': return import('../../resources/nls/uk/bundle.js');
    case '../../resources/nls/vi/bundle.ts': return import('../../resources/nls/vi/bundle.js');
    case '../../resources/nls/zh-Hans/bundle.ts': return import('../../resources/nls/zh-Hans/bundle.js');
    case '../../resources/nls/zh-Hant/bundle.ts': return import('../../resources/nls/zh-Hant/bundle.js');
    default: return new Promise(function(resolve, reject) {
      (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
        reject.bind(null, new Error("Unknown variable dynamic import: " + path))
      );
    })
   }
 }
const IS_CHROME_HEADLESS = navigator?.userAgent?.includes('HeadlessChrome');
const TOOLTIP_TEST_TIMEOUT = 5000;
const series = [
    {
        name: 'Series 1',
        id: 'Series 1',
        items: [
            {
                id: '1',
                value: 1
            },
            {
                id: '2',
                value: 2
            }
        ]
    }
];
const setupBarChart = async (options) => {
    const defaultProps = {
        width: '500px',
        height: '500px',
        series,
        groups: [{ id: 'Group1' }, { id: 'GroupB' }],
        getDataItem: (i, j) => series[i].items[j],
        'aria-label': 'ariaText'
    };
    const locale = matchTranslationBundle(['en'], new Set(['en-US', 'en']));
    const { default: translations } = await __variableDynamicImportRuntime0__(`../../resources/nls/${locale}/bundle.ts`);
    const env = {
        translations: { '@oracle/oraclejet-preact': translations }
    };
    const barChartProps = { ...defaultProps, ...options };
    const barChart = jsx(BarChart, { ...barChartProps });
    const view = render(jsx(RootEnvironmentProvider, { environment: env, children: barChart }));
    await waitFor(() => {
        const chart = screen.getByRole('application');
        expect(chart).to.be.not.null;
    }, {
        timeout: 5000
    });
    return view;
};
describe('Test BarChart component', () => {
    beforeEach(() => {
        setupUseTextDimensionsDependenciesMock(window);
    });
    it('render', async function () {
        await setupBarChart();
        const ariaRole = screen.getByRole('application');
        expect(ariaRole).not.null;
    });
    const clientHints = getClientHints();
    if (typeof jest === 'undefined') {
        if (clientHints.browser === 'chrome') {
            mocha.timeout(TOOLTIP_TEST_TIMEOUT);
            if (!IS_CHROME_HEADLESS) {
                it('handles text rotation and truncation', async function () {
                    const items = gdpData.map((i, index) => ({
                        id: index,
                        value: i.gdp
                    }));
                    await setupBarChart({
                        width: '1000px',
                        height: '300px',
                        series: [
                            {
                                id: 0,
                                name: 'GDP',
                                items
                            }
                        ],
                        getDataItem: (_, gIndex) => items[gIndex],
                        groups: gdpData.map((i) => ({
                            id: i.country
                        }))
                    });
                    // TODO:JET-65258
                    // workaround for test issue JET-65258
                    // some dom are missing from chart if we do not add
                    // this await userEvent.tab() and hence tests to check
                    // dom will fail; maybe it's a delay issue.
                    await userEvent.tab();
                    await userEvent.tab();
                    const chart = screen.getByRole('application');
                    const queryAllByDataObject = queryAllBy('data-oj-text');
                    const text = queryAllByDataObject(chart, 'Bosnia and Herzegovina');
                    expect(text[0].textContent).equals('Bosnia and H…');
                    await userEvent.hover(text[0]);
                    await waitFor(() => checkTooltipText('Bosnia and Herzegovina'), {
                        timeout: 5000
                    });
                });
            }
        }
        it('drag mode buttons', async function () {
            await setupBarChart({
                dragMode: 'user',
                zoomAndScroll: 'live',
                selectionMode: 'multiple',
                width: '500px',
                height: '500px',
                series,
                groups: [{ id: 'Group1' }, { id: 'GroupB' }],
                getDataItem: (i, j) => series[i].items[j],
                'aria-label': 'ariaText'
            });
            const chart = screen.getByRole('application');
            expect(chart).not.null;
            const queryAllByGroupIndex = queryAllBy('data-oj-group-index');
            const firstBar = queryAllByGroupIndex(chart, '0')[0];
            await userEvent.hover(firstBar);
            await waitFor(() => {
                const buttons = screen.getByRole('toolbar');
                expect(buttons).not.null;
                // eslint-disable-next-line
                expect(buttons.children.length).to.equal(2);
                if (clientHints.platform === 'mac' || clientHints.platform === 'windows') {
                    expect(screen.getByText('Marquee zoom')).not.null;
                    expect(screen.getByText('Marquee select')).not.null;
                }
                else if (clientHints.deviceType === 'phone') {
                    expect(screen.getByText('Pan')).not.null;
                    expect(screen.getByText('Marquee select')).not.null;
                }
            });
        });
        it('drag mode buttons when selection mode is multiple', async function () {
            await setupBarChart({
                selectionMode: 'multiple',
                width: '500px',
                height: '500px',
                series,
                groups: [{ id: 'Group1' }, { id: 'GroupB' }],
                getDataItem: (i, j) => series[i].items[j],
                'aria-label': 'ariaText'
            });
            const chart = screen.getByRole('application');
            expect(chart).not.null;
            const queryAllByGroupIndex = queryAllBy('data-oj-group-index');
            const firstBar = queryAllByGroupIndex(chart, '0')[0];
            await userEvent.hover(firstBar);
            await waitFor(() => {
                if (clientHints.platform === 'mac' || clientHints.platform === 'windows') {
                    expect(screen.queryByText('Marquee select')).to.be.null;
                }
                else if (clientHints.deviceType === 'phone') {
                    const button = screen.getByRole('toolbar');
                    expect(button).not.null;
                    expect(button.children.length).to.equal(1);
                    expect(screen.getByText('Marquee select')).not.null;
                }
            });
        });
    }
    it('Renders data label', async function () {
        await setupBarChart({
            width: '500px',
            height: '500px',
            getDataItem: (i, j) => ({
                ...series[i].items[j],
                labelPosition: 'center',
                label: series[i].items[j].value.toString()
            }),
            series,
            groups: [{ id: 'Group1' }, { id: 'GroupB' }]
        });
        // TODO:JET-65258
        // workaround for test issue JET-65258
        // some dom are missing from chart if we do not add
        // this await userEvent.tab() and hence tests to check
        // dom will fail; maybe it's a delay issue.
        await userEvent.tab();
        await userEvent.tab();
        const label1 = screen.getByText('2');
        const label2 = screen.getByText('1');
        expect(label1).to.be.not.null;
        expect(label2).to.be.not.null;
    });
    if (typeof jest === 'undefined') {
        it('trigger contextMenu on right click', async () => {
            const { container } = await setupBarChart({
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxs(Fragment, { children: [jsx(MenuItem, { label: "MenuItem1" }), jsx(MenuItem, { label: "MenuItem2" }), jsx(MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            const barItem = 
            // eslint-disable-next-line
            container.firstElementChild?.firstElementChild?.firstElementChild?.firstElementChild;
            // eslint-disable-next-line
            const baChart = // eslint-disable-next-line
             container.firstElementChild?.firstElementChild?.firstElementChild;
            //We do the necessary to have firstItem as current item
            fireEvent.contextMenu(baChart, {
                clientX: 50,
                clientY: 50,
                currentTarget: barItem
            });
            const menu = getMenuItemByRole('menu');
            const menuItems = getAllMenuItemsByRole('menuitem');
            //With this we check context menu context was set correctly
            const menuItemGotByLabel = getLabel('MenuItem1');
            expect(menu).not.null;
            expect(menuItems.length).equals(3);
            expect(menuItemGotByLabel).not.null;
        });
        it('trigger contextMenu from keyboard', async () => {
            const { container } = await setupBarChart({
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxs(Fragment, { children: [jsx(MenuItem, { label: "MenuItem1" }), jsx(MenuItem, { label: "MenuItem2" }), jsx(MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            // eslint-disable-next-line
            const root = container.firstElementChild?.firstElementChild;
            await userEvent.tab();
            await userEvent.keyboard('[ENTER]');
            fireEvent.keyDown(root, { key: 'F10', shiftKey: true });
            const menu = getMenuItemByRole('menu');
            const menuItems = getAllMenuItemsByRole('menuitem');
            //With this we check context menu context was set correctly
            const menuItemGotByLabel = getLabel('MenuItem1');
            expect(menu).not.null;
            expect(menuItems.length).equals(3);
            expect(menuItemGotByLabel).not.null;
        });
        it('renders overview content', async () => {
            const { container } = await setupBarChart({
                overview: 'on',
                series: [
                    {
                        name: 'Series 1',
                        id: 'Series 1',
                        items: [
                            {
                                id: '1',
                                value: 1
                            },
                            {
                                id: '2',
                                value: 2
                            },
                            {
                                id: '3',
                                value: 1
                            },
                            {
                                id: '4',
                                value: 2
                            }
                        ]
                    }
                ],
                groups: [{ id: 'GroupA' }, { id: 'GroupB' }, { id: 'GroupC' }, { id: 'GroupD' }],
                xAxis: {
                    viewportMax: 2,
                    viewportMin: 1
                }
            });
            // eslint-disable-next-line
            const svgs = container.querySelectorAll('svg');
            expect(svgs.length).to.equal(6);
            // eslint-disable-next-line
            expect(svgs[0].parentElement?.getAttribute('tabIndex')).to.equal('0');
            // eslint-disable-next-line
            expect(svgs[1].parentElement?.getAttribute('tabIndex')).is.null;
            const chartStyles = getComputedStyle(svgs[0]);
            const overviewStyles = getComputedStyle(svgs[1]);
            expect(chartStyles.width).to.equal(overviewStyles.width);
            expect(parseInt(overviewStyles.height)).to.lessThanOrEqual(parseInt(chartStyles.height));
            const queryAllByDataObject = queryAllBy('data-oj-object');
            const chart = screen.getByRole('application');
            const window = queryAllByDataObject(chart, 'window');
            // eslint-disable-next-line
            const background = window[0].parentElement?.children[0];
            // @ts-ignore
            const windowWidth = window[0].getBBox().width;
            // @ts-ignore
            const backgroundWidth = background.getBBox().width;
            expect(windowWidth / backgroundWidth).to.closeTo(0.25, 0.05);
        });
    }
});
if (typeof jest === 'undefined') {
    describe('Drag and Drop', () => {
        let originalMouseDescriptors;
        beforeEach(() => {
            originalMouseDescriptors = mockMouseEventPageXYOffsetXY();
            setupUseTextDimensionsDependenciesMock(window);
        });
        afterEach(() => restoreMouseEventPageXYOffsetXY(originalMouseDescriptors));
        it('Drag item and Drop on y axis Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'yAxis') {
                    callbacks.dropDetailCorrect = true;
                    expect(detail.y).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 20,
                clientY: 20
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[4];
            testDnd(item, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag item and Drop on x axis Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'xAxis') {
                    callbacks.dropDetailCorrect = true;
                    expect(detail.x).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 40,
                clientY: 480
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[5];
            testDnd(item, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag group and Drop on plot area Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'xAxisTickLabel') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'plotArea') {
                    callbacks.dropDetailCorrect = true;
                    expect(detail.x).to.not.null;
                    expect(detail.y).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const groupDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                groupDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const group = chart.querySelector('[data-oj-object="group"][data-oj-group-index="0"]');
            expect(group.getAttribute('data-oj-object')).to.equal('group');
            const dropOptions = {
                clientX: 40,
                clientY: 40
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[1];
            testDnd(group, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag item and Drop on y axis Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 20,
                clientY: 20
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[4];
            testDnd(item, chart, dropRect, callbacks, true, dropOptions, true);
        });
        it('Drag item and Drop on x axis Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 40,
                clientY: 480
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[5];
            testDnd(item, chart, dropRect, callbacks, true, dropOptions, true);
        });
        it('Drag group and Drop on plot area Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'xAxisTickLabel') {
                    callbacks.dragDetailCorrect = true;
                    expect(detail.groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const groupDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                groupDraggable
            });
            const chart = screen.getByRole('application');
            await userEvent.tab();
            // eslint-disable-next-line
            const group = chart.querySelector('[data-oj-object="group"][data-oj-group-index="0"]');
            expect(group.getAttribute('data-oj-object')).to.equal('group');
            const dropOptions = {
                clientX: 40,
                clientY: 40
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[1];
            testDnd(group, chart, dropRect, callbacks, true, dropOptions, true);
        });
    });
}
describe('Test BarChart component with no data', () => {
    if (typeof jest === 'undefined') {
        it('should not trigger context menu when there is no data', async () => {
            const { container } = await setupBarChart({
                series: [], // Empty series, no data
                groups: [],
                getDataItem: () => undefined,
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxs(Fragment, { children: [jsx(MenuItem, { label: "MenuItem1" }), jsx(MenuItem, { label: "MenuItem2" }), jsx(MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            const root = container.firstElementChild?.firstElementChild;
            await userEvent.tab();
            await userEvent.keyboard('[ENTER]');
            fireEvent.keyDown(root, { key: 'F10', shiftKey: true });
            const menu = screen.queryByRole('menu');
            expect(menu).to.be.null;
        });
    }
});
//# sourceMappingURL=BarChart.spec.js.map
