import theme from '../../../theme';

import { mapColorFromIntent, mapStrokeWidthFromSize } from '../ProgressCircle';

describe('mapColorFromIntent', () => {
  const { primary, danger, success, error, warning } = theme.colors.progress;

  it.each`
    intent       | expectedColor
    ${'primary'} | ${primary}
    ${'danger'}  | ${danger}
    ${'success'} | ${success}
    ${'error'}   | ${error}
    ${'warning'} | ${warning}
  `(
    'returns $expectedColor color from $intent intent',
    ({ intent, expectedColor }) => {
      expect(mapColorFromIntent(intent, theme)).toBe(expectedColor);
    }
  );
});

describe('mapStrokeWidthFromSize', () => {
  const { circleSmallStroke, circleMediumStroke } = theme.sizes.progress;

  it.each`
    size        | expectedStrokeWidth
    ${'small'}  | ${circleSmallStroke}
    ${'medium'} | ${circleMediumStroke}
  `(
    'returns $expectedColor color from $intent intent',
    ({ size, expectedStrokeWidth }) => {
      expect(mapStrokeWidthFromSize(size, theme)).toBe(expectedStrokeWidth);
    }
  );
});
