import React from 'react';
import { cleanup } from '@testing-library/react';
import { render } from '../../utils/theme-render-wrapper';
import { ProgressBar } from './progressbar';

afterEach(cleanup);

const topText = 'topText';
const rightText = 'rightText';
const bottomText = 'bottomText';
const leftText = 'leftText';

describe('<ProgressBar />', () => {
  it(`Should render ProgressBar without texts`, () => {
    render(<ProgressBar value={100} />);
  });
  it(`Should render ProgressBar with a texts and props`, () => {
    const { getByText } = render(
      <ProgressBar
        texts={{
          top: topText,
          right: rightText,
          left: leftText,
          bottom: bottomText
        }}
        value={100}
      />
    );
    let elm = getByText(topText);
    expect(elm).toBeTruthy();
    elm = getByText(rightText);
    expect(elm).toBeTruthy();
    elm = getByText(bottomText);
    expect(elm).toBeTruthy();
    elm = getByText(leftText);
    expect(elm).toBeTruthy();
  });
});
