import {getMaxSnapPoint} from '@components/Modals/components/BottomSheet/utils';

import {
  NUMERIC_SNAP_POINTS,
  NUMERIC_LARGE,
  RATIO_SNAP_POINTS,
  WINDOW_HEIGHT_LARGE,
  NUMERIC_RATIO_SNAP_POINTS,
  RATIO_NUMERIC_SNAP_POINTS,
} from './constants';

jest.mock('@shared/utils', () => ({
  isIos: true,
  isAndroid: false,
}));

describe('getMaxSnapPoint isIos', () => {
  test.each([
    ['Numeric', NUMERIC_SNAP_POINTS, NUMERIC_LARGE],
    ['Ratio', RATIO_SNAP_POINTS, WINDOW_HEIGHT_LARGE],
    ['Numeric and Ratio', NUMERIC_RATIO_SNAP_POINTS, WINDOW_HEIGHT_LARGE],
    ['Ratio and Numeric', RATIO_NUMERIC_SNAP_POINTS, NUMERIC_LARGE],
  ])(
    'returns last value from %s snap points',
    (_desc, snapPoints, expectedReturnValue) => {
      expect(getMaxSnapPoint(snapPoints)).toBe(expectedReturnValue);
    },
  );
});
